-
Notifications
You must be signed in to change notification settings - Fork 34.8k
Closed
Labels
Milestone
Description
refs: #165445
microsoft/vscode-jupyter#14821
- macOS: @anthonykim1
- linux @roblourens
- windows @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 notebook
and 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 Variables
section - 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