-
Notifications
You must be signed in to change notification settings - Fork 206
Revise Python Notebook learning experience prototype #3526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Andrew Casey (amcasey)
wants to merge
102
commits into
main
Choose a base branch
from
amcasey/PythonLearning
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
102 commits
Select commit
Hold shift + click to select a range
5523994
python notebooks in QDK Learning
minestarks 13307b8
Add TODO
amcasey cc7cc6e
Cleanup and notes from AI review
amcasey afbdf9c
Move dummy course into test workspace
amcasey 6fcdd63
Fix tests other than env check
amcasey c35cc82
DO NOT MERGE env check logging
amcasey b29f5be
Handle lack of uv
amcasey 33a5d03
TODOs for qsharp-vscode.learningDoctor
amcasey d292482
More TODOs
amcasey dd4d157
Handle exception in import check
amcasey 23124b1
Transfer TODOs from draft PR
amcasey 9f3b313
First cut at using cell ID rather than cell index
amcasey cb2d162
Only offer hints for exercise cells
amcasey 6ee6530
More TODOs
amcasey 062e6aa
Tidy diff in agent file
amcasey aa28d8e
TODOs and tweaks from diff review
amcasey 073f94c
More TODOs
amcasey 793bcb8
First cut at consuming Python Environments API
amcasey 8740f06
DO NOT MERGE local launch.json
amcasey e4cdd6a
Replace all direct python access with env API calls
amcasey f3982ef
Detect the absence of a venv
amcasey 824913c
Drop most of CourseEnvironment
amcasey 57f5874
Wire up course.json import checks
amcasey 9ed8a08
Use requirements.txt instead of pyproject.toml for easier parsing
amcasey ce9797e
Handle requirements.txt ourselves
amcasey 4707736
Remove requirements.txt parsing
amcasey 40bbd28
Don't throw from ensureEnvironment
amcasey 18a5b3c
Tidy up environments.ts
amcasey f694920
Drop readme location from course.json
amcasey 3ad7b6c
Drop commands and pyproject.toml from _check_env.py
amcasey a0e70ca
Make report theme-safe
amcasey 3b38421
First cut at opening notebook with specific kernel using unstable API
amcasey b335b57
Rename functions
amcasey bb7c4fc
Add more error handling around unstable call
amcasey a275008
Add diagnostics to the notebook toolbar
amcasey 94421b2
Apply notebook hack to commands.ts
amcasey cc8ed3a
Fix cell ID in _exercises.json
amcasey ef6f919
Remove hint from notebook toolbar
amcasey 8d11958
Add TODO
amcasey 28f50f4
Auto save on cell execution
amcasey d268ccd
Respect themese in exercise reports
amcasey fa53265
Rename _exercises.json to exercises.json
amcasey e640a0d
Navigate to particular exercise from tree view
amcasey 48fd874
Improve scrolling
amcasey 7ca6960
First cut at hiding the panel for notebook courses
amcasey e17a419
Use the readme as a splash screen
amcasey 586eb12
Auto-save on open
amcasey bd990b2
Delete tests
amcasey f46ca9f
Re-open notebook after resetting
amcasey 719f57b
Improve scrolling to locations indicated by tree
amcasey 0910c89
Reset all exercises in unit
amcasey 09abe55
Reopen after applying fixes
amcasey b6aac86
Drop the sentinel file for completion tracking
amcasey b1d1d0c
Drop complete_unit()
amcasey ef7f9ce
Eliminate exercises.json in favor of authoring within the notebook
amcasey b447b5b
Update codespaces launch.json
amcasey 1178c51
TODO for new environment approach
amcasey e3f0a51
Ignore vscode folders in test workspaces
amcasey 2dd552d
Create a python project for the active course
amcasey 4fc6f27
Initialize service when VS Code session starts with open notebook
amcasey cc493f2
Switch the cell context menu button from hint to explain
amcasey 4253e93
Add TODOs
amcasey 958fab3
Create the python project when the venv is created
amcasey c4620f1
Clean up findEnvironment
amcasey dffd886
Don't reopen notebook after environment repair
amcasey 635d38d
Drop test hook for now
amcasey 508e33d
INTERESTING Drop special openNotebook call
amcasey 6186a26
Drop old logging
amcasey 7ac9d0b
Drop unused fix kinds
amcasey 35447eb
Clean up old TODOs
amcasey ae768f3
Add clarifying comments
amcasey 2044b0b
Log finding the wrong number of notebooks in a unit
amcasey 96af1ac
Warn when course isn't found
amcasey 7c5cb40
Extract fsUtils
amcasey ace2d7c
Combine some notebook cleanup code
amcasey a1c1a0f
Clean up TODOs
amcasey 4bb0dad
Extract missing extension helper
amcasey 63efad1
Split up pythonRunner
amcasey 207e602
Drop printf logging from env check
amcasey a0c1871
Await extension installation and add some TODOs
amcasey 8809c72
Inline setupActiveEnvironment
amcasey 5bde830
Address review feedback
amcasey 790cc32
Clean up unused field
amcasey 14656ff
Handle a race in panel message passing
amcasey 6d96973
Fix typo
amcasey 6e9f7c4
Remove dead comment
amcasey 99052a3
Add todo
amcasey adf58be
Fix initialization race
amcasey e6bf1aa
Tidy up duplicate ProgressData
amcasey 5f50a2e
Drop continue node in notebook courses
amcasey ddc394c
Remove course icon color
amcasey 1a843a5
Handle or expand easy TODOs
amcasey 46392d6
Change getExerciseCellIds to isExerciseCellId
amcasey da8ba60
Extract ipynb parser
amcasey 99db370
First cut at rationalizing catalogs and course providers
amcasey aee7570
Validate paths from course.json
amcasey 3a1f6bf
Comment about HTML injection
amcasey ea694f3
Handle environment creation race
amcasey af0644b
Remove stale TODOs
amcasey ed12f40
Merge branch 'main' into amcasey/PythonLearning
amcasey 693c010
Drop references to non-existent integration tests
amcasey eb30e63
Drop additional reference to non-existent browser tests
amcasey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,4 @@ out/ | |
| test/out/ | ||
| wasm/ | ||
| *.vsix | ||
| .vscode/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -326,6 +326,10 @@ | |
| "command": "qsharp-vscode.learningResetExercise", | ||
| "when": "false" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningResetUnit", | ||
| "when": "false" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningShowActivity", | ||
| "when": "false" | ||
|
|
@@ -341,6 +345,26 @@ | |
| { | ||
| "command": "qsharp-vscode.learningAskInChat", | ||
| "when": "false" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningSwitchCourse", | ||
| "when": "false" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningCourseInfo", | ||
| "when": "false" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningCheckEnvironment", | ||
| "when": "qsharp-vscode.learningWorkspaceDetected" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningNotebookHint", | ||
| "when": "false" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningNotebookExplain", | ||
| "when": "false" | ||
| } | ||
| ], | ||
| "view/title": [ | ||
|
|
@@ -371,6 +395,32 @@ | |
| } | ||
| ], | ||
| "view/item/context": [ | ||
| { | ||
| "command": "qsharp-vscode.learningSwitchCourse", | ||
| "group": "inline", | ||
| "when": "view == qsharp-vscode.learningTree && (viewItem == course || viewItem == coursePython)" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningCourseInfo", | ||
| "group": "inline", | ||
| "when": "view == qsharp-vscode.learningTree && (viewItem == course || viewItem == coursePython)" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningSwitchCourse", | ||
| "when": "view == qsharp-vscode.learningTree && (viewItem == course || viewItem == coursePython)" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningCourseInfo", | ||
| "when": "view == qsharp-vscode.learningTree && (viewItem == course || viewItem == coursePython)" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningCheckEnvironment", | ||
| "when": "view == qsharp-vscode.learningTree && viewItem == coursePython" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningResetUnit", | ||
| "when": "view == qsharp-vscode.learningTree && viewItem == unitPython" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.workspaceOpenPortal", | ||
| "group": "inline", | ||
|
|
@@ -417,7 +467,26 @@ | |
| { | ||
| "command": "qsharp-vscode.learningAskInChat", | ||
| "group": "inline", | ||
| "when": "view == qsharp-vscode.learningTree && (viewItem == continue || viewItem == unit || viewItem == lesson || viewItem == exercise || viewItem == example)" | ||
| "when": "view == qsharp-vscode.learningTree && (viewItem == continue || viewItem == unit || viewItem == unitPython || viewItem == lesson || viewItem == exercise || viewItem == example)" | ||
| } | ||
| ], | ||
| "notebook/toolbar": [ | ||
| { | ||
| "command": "qsharp-vscode.learningCheckEnvironment", | ||
| "when": "qsharp-vscode.learningNotebookActive", | ||
| "group": "navigation@100" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningResetUnit", | ||
| "when": "qsharp-vscode.learningNotebookActive", | ||
| "group": "navigation@110" | ||
| } | ||
| ], | ||
| "notebook/cell/title": [ | ||
| { | ||
| "command": "qsharp-vscode.learningNotebookExplain", | ||
| "when": "notebookType == 'jupyter-notebook' && qsharp-vscode.learningWorkspaceDetected", | ||
| "group": "inline/cell@50" | ||
| } | ||
| ], | ||
| "explorer/context": [ | ||
|
|
@@ -694,11 +763,47 @@ | |
| "category": "QDK Learning", | ||
| "icon": "$(discard)" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningResetUnit", | ||
| "title": "Reset Unit", | ||
| "category": "QDK Learning", | ||
| "icon": "$(discard)" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningShowActivity", | ||
| "title": "Show Current Activity", | ||
| "category": "QDK Learning", | ||
| "icon": "$(mortar-board)" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningSwitchCourse", | ||
| "title": "Switch Course", | ||
| "category": "QDK Learning", | ||
| "icon": "$(arrow-swap)" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningCourseInfo", | ||
| "title": "Course Info", | ||
| "category": "QDK Learning", | ||
| "icon": "$(info)" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningCheckEnvironment", | ||
| "title": "Run Course Diagnostics", | ||
| "category": "QDK Learning", | ||
| "icon": "$(pulse)" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningNotebookHint", | ||
| "title": "Ask for a Hint", | ||
| "category": "QDK Learning", | ||
| "icon": "$(comment-discussion-sparkle)" | ||
| }, | ||
| { | ||
| "command": "qsharp-vscode.learningNotebookExplain", | ||
| "title": "Explain", | ||
| "category": "QDK Learning", | ||
| "icon": "$(comment-discussion-sparkle)" | ||
| } | ||
| ], | ||
| "breakpoints": [ | ||
|
|
@@ -1331,6 +1436,94 @@ | |
| "additionalProperties": false | ||
| } | ||
| }, | ||
| { | ||
| "name": "qdk-learning-list-courses", | ||
| "tags": [ | ||
| "qdk", | ||
| "qdk-learning", | ||
| "quantum-katas" | ||
| ], | ||
| "toolReferenceName": "qdkLearningListCourses", | ||
| "displayName": "QDK Learning: List Courses", | ||
| "modelDescription": "List all available learning courses (loaded or not) with their ids, titles, kinds, and the id of the currently-active course. Use the course ids with switch-course or goto.", | ||
| "canBeReferencedInPrompt": true, | ||
| "icon": "./resources/file-icon-light.svg", | ||
| "inputSchema": { | ||
| "type": "object", | ||
| "properties": {}, | ||
| "required": [], | ||
| "additionalProperties": false | ||
| } | ||
| }, | ||
| { | ||
| "name": "qdk-learning-switch-course", | ||
| "tags": [ | ||
| "qdk", | ||
| "qdk-learning", | ||
| "quantum-katas" | ||
| ], | ||
| "toolReferenceName": "qdkLearningSwitchCourse", | ||
| "displayName": "QDK Learning: Switch Course", | ||
| "modelDescription": "Switch the active learning course. Moves to the first incomplete activity in that course and updates the panel. Use a courseId from list-courses.", | ||
| "canBeReferencedInPrompt": true, | ||
| "icon": "./resources/file-icon-light.svg", | ||
| "inputSchema": { | ||
| "type": "object", | ||
| "properties": { | ||
| "courseId": { | ||
| "type": "string", | ||
| "description": "ID of the course to switch to (from list-courses)." | ||
| } | ||
| }, | ||
| "required": [ | ||
| "courseId" | ||
| ], | ||
| "additionalProperties": false | ||
| } | ||
| }, | ||
| { | ||
| "name": "qdk-learning-course-info", | ||
| "tags": [ | ||
| "qdk", | ||
| "qdk-learning", | ||
| "quantum-katas" | ||
| ], | ||
| "toolReferenceName": "qdkLearningCourseInfo", | ||
| "displayName": "QDK Learning: Course Info", | ||
| "modelDescription": "Return the descriptor and README content (if any) for a course. Defaults to the active course when no courseId is provided.", | ||
| "canBeReferencedInPrompt": true, | ||
| "icon": "./resources/file-icon-light.svg", | ||
| "inputSchema": { | ||
| "type": "object", | ||
| "properties": { | ||
| "courseId": { | ||
| "type": "string", | ||
| "description": "ID of the course. Omit for the active course." | ||
| } | ||
| }, | ||
| "required": [], | ||
| "additionalProperties": false | ||
| } | ||
| }, | ||
| { | ||
| "name": "qdk-learning-check-environment", | ||
| "tags": [ | ||
| "qdk", | ||
| "qdk-learning", | ||
| "quantum-katas" | ||
| ], | ||
| "toolReferenceName": "qdkLearningCheckEnvironment", | ||
| "displayName": "QDK Learning: Check Environment", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Switch course review |
||
| "modelDescription": "Run environment diagnostics for the active learning course. Returns structured checks (Python interpreter, virtual environment, fingerprint, required packages) and whether a one-click environment setup can fix any failures. Q# courses need no environment and pass trivially.", | ||
| "canBeReferencedInPrompt": true, | ||
| "icon": "./resources/file-icon-light.svg", | ||
| "inputSchema": { | ||
| "type": "object", | ||
| "properties": {}, | ||
| "required": [], | ||
| "additionalProperties": false | ||
| } | ||
| }, | ||
| { | ||
| "name": "qdk-learning-next", | ||
| "tags": [ | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a few commands and tools could be removed in case unnecessary