question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Interactive Window improvements and issues

See original GitHub issue

Hi! I tried to integrate notebooks-related functionality in my daily workflow. Not everything was smooth and I returned to JupyterLab in the end. However, the transition was very close to becoming successful, I really liked some features! I would like to share some feedback.

High level impressions

I realized that “cells” within .py-files is the best form of a “Notebook” to me. Reasons:

  • I get 100% of VSCode functionality (especially the editor)
  • I have one and only one interface for code editing, regardless of what I am doing (writing C++ or drawing plots with Python in “Notebook”)
  • I can run ad hoc snippets in the interactive window without touching the original script
  • I can seamlessly switch between running the script with the “python” command in the terminal and running it in the Interactive Mode without conversions from .py to .ipynb and vice versa
  • I get clear diffs when VCS is involved
  • everything else where .py is better at than .ipynb

In fact, all listed reasons can be compressed to one: “I strongly prefer .py files to .ipynb”.

Cells within .py

I mean the “# %%” thing that I praised above 😄 I had the following problems with it:

  1. Performance decreases over time. I use VSCode to work on remote machine (not sure if it matters). After every (or so) kernel reloading the lag between my “shift+enter” and the VSCode’s reaction (in the form of running the cell/selected code in the interactive window) becomes larger and larger up to 10 seconds (I needed to reload absolutely everything, VSCode included, in order to fix this). In other words, something was leaking, but I didn’t understand, what exactly. Probably, the problem is there for Notebook Editor as well, but I spent less time with it, so I’m not sure.
  2. No cells folding. I missed this feature from JupyterLab.
  3. No shortcuts for operations within cells such as “go to the first line of cell”, “select all the code within the cell” and so on.
  4. No cell-level navigation. In JupyterLab, I can navigate between cells by exiting the editor mode (by pressing Esc) and using arrows. The functionality is not somewhat crucial, but some shortcut for traveling between cells would be nice to have.
  5. No notebook-shortcuts (except for the “Shift+Enter”). Things like “Create a cell below” would make my life a bit easier.

In fact, only the first reason is a major blocker for me.

Notebook editor

For now, I prefer JupyterLab for working with .ipynb, however, I spent some time with Notebook Editor and here are some things I would like to mention:

  1. No “Go To Definition”
  2. No multiple cursors across cells (I mean the “Cmd+D” thing).
  3. No rulers
  4. Color theme doesn’t work properly (the dark theme I use (“1337”) is automatically replaced with the native dark theme).
  5. No brackets highlighting
  6. No cells folding

1, 2, 3 and 5 seem to be caused by the same fact that the editor is different from the native VSCode editor.

Common for both

  1. I still don’t understand how I can shutdown running kernels.
  2. No shortcut for reloading the kernel (had to do that with the mouse 😄 ).

Software:

Visual Studio Code: 1.45.0
Python (VSCode extension): 2020.5.78807
python==3.7.7
jupyterlab==2.1.2

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
greazercommented, Jun 17, 2020

Thanks for all the great feedback! The biggest takeaway I’m getting from this is that the interactive experience could literally be a replacement for notebook development, IF it supported/emulated some of the same experiences that are possible in a notebook. In addition, @earthastronaut, your closing thought is really interesting new idea about enabling a mix of standard python script with embedded “cells”. I’m generalizing your suggestion beyond just doing it for the if…main… block, say for example if you could define a function and within that function have a concept of cells. This sounds like it could become a complicated problem, but I believe it’s worth thinking about.

I’m going to turn this issue into one that is specifically designed to exist as an “idea-factory” for things we could do to make the current script cell experience more powerful and useful. From this issue, ideas that have merit for further investigation should be pulled out into separate issues.

The notebook-specific feedback here is covered by what @rchiodo said above – those limitations will be addressed when we finally can move to the VS Code native notebook API.

3reactions
Yura52commented, May 15, 2020

Thanks for the detailed answer! I will remember the trick with searching desired command in the palette 😃

There are a number of cell level commands

Here are the examples of commands that are missing and that I use in JupyterLab:

  • Add a cell above/below the current cell (not at the end of the file; I solved the “below” version by creating a shortcut that simple inserts the “# %%” thing)
  • Go to the previous/next cell (it is done simply with arrow keys in JupyterLab)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Interactive Window improvements and issues #1248 - GitHub
Hi! I tried to integrate notebooks-related functionality in my daily workflow. Not everything was smooth and I returned to JupyterLab in the ...
Read more >
Fixes or workarounds for recent issues in Outlook for PC
Check out this article: Resolve Outlook for Windows issues with automated troubleshooting tools. Jump to each section on this page for specific Outlook ......
Read more >
Python interactive window problem : r/vscode - Reddit
Honestly I'was using interactive python window a lot, but never used the command line here, I was always running code from editor pane...
Read more >
Institute for Healthcare Improvement: Improving Health and ...
Institute for Healthcare Improvement (IHI) focuses on improvement science and patient safety to advance and sustain better outcomes in health and health ...
Read more >
Best Replacement Window Buying Guide - Consumer Reports
And they can claim the Energy Efficient Home Improvement Credit, ... Supply-chain issues that have plagued so many businesses have also hit ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found