Repository navigation
Closed
Labels
Milestone
Description
refs: #165445
microsoft/vscode-jupyter#14821
- macOS: Anthony Kim (@anthonykim1)
- linux roblourens
- windows Martin Aeschlimann (@aeschli)
Complexity: 4
Pre-requisites - If you don't have python set up to run notebooks
- ensure python is installed on your machine
- install the latest pre-release Python and Jupyter extensions
- open a workspace where you will be running tests for this TPI
Create: new jupyter notebookand runprint(1)in a cell.
a. If the cell runs successfully, you're already set up, otherwise...- The kernel picker should open, select "Python Environments..." -> "Create Python Environment..." -> select venv or conda, and whichever version you'd like.
A virtual environment should get created in your workspace with all necessary packages installed, and the cell should run successfully.
Testing
The jupyter extension is the only extension with a variable provider at this point, and only for python
- set
"notebook.experimental.variablesView": true,in settings - Create a notebook and run python cells that assign variables (sample code below)
- Open the debug view and find the new
Notebook Variablessection - explore the variables
Known issues / shortcomings
Improve large collection handling: #203060
More detail in value for collections: microsoft/vscode-jupyter#15056
Keep expanded state persistent: #203067
Don't show the notebook variable view when not applicable: #203068
sample code
simple types
aString = "Hello"
aList = [1, 3, aString]
listOfLists = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
aTuple = (3, 4, aString)
aSet = {5, 6, aTuple, aString}
aDict = {"key1": 8, "key2": aSet}
anInt = 11
aFloat = 11.3
boolean = False
objects
class A:
prop1 = 1
prop2 = 2
def __init__(self, a, b):
self.a = a
self.b = b
self.list = [1, 2, 3]
class B:
propList = [A(100, 200), A(300, 400)]
anObject = A(12, 15)
nestedObject = B()
long list
aLongList = []
for i in range(100000):
aLongList.append('listEntry' + str(i))
circular reference
dict1 = {'key1': 1}
dict2 = {'key2': 2, 'otherDict': dict1}
dict1['otherDict'] = dict2
Activity
roblourens commentedon Jan 23, 2024
I got caught by not being able to expand nodes while paused in the debugger. At one point I was thinking that while paused, we might use the debugger to update values. Is that not actually possible, or would you try that at some point?
amunger commentedon Jan 23, 2024
We could do that, the extension's view does by delegating to either a debug provider or kernel provider. I was just thinking that the debug variables view already contains all that info, but it is a strange behavior.