Jupyter in Visual Studio Code – June 2021 Release

Jeffrey

We are pleased to announce that the June 2021 release of the Jupyter Extension for Visual Studio Code is now available. If you are working with Python, we recommend downloading the Python extension from the Marketplace, or installing it directly from the extension gallery in Visual Studio Code. If you already have the Python extension installed, you can also get the latest update by restarting Visual Studio Code. You can learn more about  Python support in Visual Studio Code in the documentation.

This release focused on:

  • Enhanced security measures
  • Additional Native Notebook layout settings
  • Improvements to our Data Viewer and Variable Explorer.

If you’re interested, you can check the full list of improvements in our changelog.

Workspace Trust

Visual Studio Code takes security seriously and the Workspace Trust feature allows you to determine which project folders and content you trust, and which ones you would like to keep in restricted mode.

What does this mean with respect to notebooks?

When opening a folder in VS Code, you will be asked if you trust the authors and content of the folders.

Image workspace trust dialog

If you trust a folder, any notebooks and their outputs will be rendered and can run code. If you do not trust a folder with notebooks in them, you will be in restricted mode. If you would like to change restricted mode to trusted, click on the gear at the bottom left and select “Manage Workspace Trust”.

Image gear manage workspace trust

**Note: It is important to understand that notebooks may have harmful code embedded in their outputs and may run without you executing the cells. VS Code will suppress outputs until you have explicitly trusted the notebook. It is important to determine whether you trust notebooks that are downloaded or come from external sources.

For more information and details about Workspace Trust please see Visual Studio Code – Workspace Trust

Improved Filtering in Data Viewer

The Data Viewer now has improved capabilities for filtering string values with added support for the * wildcard character. In the example below, the column being filtered on contains both “male” and “female” entries. Searching for the values “male” will now only return exact matches. To search for all values that end in “male”, simply type “*male” into the filter box. The * wildcard character will match any number of characters and can be used anywhere in the string.

Image June21 8211 Wildcard

Sorting in Variable Explorer

By popular demand, variables in your notebook can now be sorted! Click on the “Name” or “Type” headers in Variable Explorer to sort. The direction of the arrow in the header will indicate which header the variables are being sorted on and whether the sort is in alphabetical or reverse alphabetical order.

Image June21 8211 VE Sort

These long-awaited changes to the Data Viewer and Variable Explorer have been implemented by our very own Microsoft Jupyter Extension Software Engineering Intern, Vandy Liu! Thank you Vandy for your hard work in shipping these great enhancements!

New Look for Native Notebooks!

To try out Native Notebooks today, download VS Code Insiders and the Jupyter extension. The Python extension is strongly recommended for working with Python notebooks.

Image June2021 8211 New Notebook Layout

  • The Notebook toolbar is now in the top left with all your favorite notebook-related actions and features.
  • The kernel picker has migrated back to the top right for easy switching between environments.
  • The cell indicator has gone bold! You can find this gutter indicator more helpful to identify where you are in the notebook, especially when working with long cells and outputs.

Customizable Native Notebooks

While the highlights above show what will come out-of-the-box for notebooks, you can always go ahead and customize the notebook to your liking! We have added a number of settings to truly make this your perfect notebook. To explore notebook layout settings, click on the “More actions” icon at the end of the toolbar and select “Customize Notebook Layout”.

This will bring you to the settings page with all notebook-related layout settings where you can create the ideal notebook layout that you prefer.

The full list of notebook layout settings are:

  • notebook.insertToolbarLocation: Controls whether the buttons to insert new cells (+Code, +Markdown) appear between cells, in the toolbar, both, or are hidden.
  • notebook.consolidatedRunButton: There are two new actions, Execute Above Cells and Execute Cell and Below. They will appear in the cell toolbar by default, but enabling this setting moves them to a new context menu next to the execute button.
  • notebook.cellFocusIndicator: Adds the option for cells to indicate their focused state with a colored bar on the side of the cell, similar to Jupyter.
  • notebook.cellToolbarVisibility: Determines whether the cell toolbar should appear when the cell is focused, or hovered. The default is to only show up when a cell is focused.
  • notebook.compactView: When enabled, cells are rendered in a more compact style with less empty space. It is enabled by default.
  • notebook.consolidatedOutputButton: The Clear Cell Outputs action and the button to pick a different output renderer or mimetype have been combined into a single  menu next to cell outputs. The new menu can be disabled with this setting.
  • notebook.dragAndDropEnabled: Disables drag and drop for cells. You can still rearrange cells using the commands Alt+Up/Alt+Down by default
  • notebook.globalToolbar: Adds a toolbar to the top of the notebook editor.
  • notebook.showCellStatusBar: This setting has a new option, visibleAfterExecute, which will hide the cell Status bar to save space until a cell is executed. Once it’s executed, it will become visible so the user can review the execution details.
  • notebook.showFoldingControls: Controls whether the folding chevron that appears on Markdown headers is always visible, or only visible on mouseover.
  • notebook.editorOptionsCustomizations: Lets the user customize the cell editor settings in the notebook.

Other Changes and Enhancements

We have also added small enhancements and fixed issues requested by users that should improve your experience working with Notebooks in Visual Studio Code. Some notable changes include:

  • Limit languages displayed in the Cell language picker to languages supported by the kernel. (#5580)
  • Add ABCMeta and type to variable explorer exclude list. (#5865)
  • Tweak variable view fit and finish to match VS Code. (#5955)
  • Hide kernels belonging to deleted Python environments from kernel picker. (#6164)

Be sure to download the Python extension and the Jupyter extension for Visual Studio Code now to try out the above improvements. If you run into any problems or have suggestions, please file an issue on the Jupyter VS Code GitHub page.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4 comments

Comments are closed. Login to edit/delete your existing comments

  • Royi Avital

    Could you add a mode that on save strip any non text data from the Notebook (Like images / Plots / etc…)?
    Namely VS Code will display the output of the cells, but on the drive only the code / markdown will be saved.
    Call it Version Control Friendly Mode which will be very important to many collaborators of notebooks .

  • Rob Fisher

    When are native notebooks coming to non-insiders vscode? I do prefer them, but have found Insiders a little buggy at times.

  • Anuj Dev

    Jupyter in Visual Studio Code is GREAT!

    But it misses on AI since neither audio or video can be heard or viewed in Jupyter in Visual Studio Code 🙁 as both IPython.display.Audio and IPython.display.Video are non-functional (for years).

  • Lee

    Hello, thanks for your great work on Jupyter in VSCode so far. I have a small point to highlight. If I have a dataframe with a column that has mixed data i.e some rows have numbers 902813 and others have numbers in a list [3910902], the variable explorer does not seem to display that. It seems to simply show them as 902813 and 3910902. I had to print() the dataframe in order to see there were mixed data types in that column. It would be really helpful if the variable explorer could show this without me troubleshooting and printing the dataframe on my own 🙂