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.

Keep python and notebook automatically in sync

See original GitHub issue

Feature: Notebook Editor, Interactive Window, Python Editor cells

Description

The notebook provides an option ‘Convert and save to a Python script’, which creates a representation of the notebook as a standard .py script using the ‘percent format’. This does not only provide yet another way to interactively work with Python and rich output – the format is also a solution to the long-standing problem that the JSON-format of .ipynb files including embedded binary data (graphics) does not play well with source control systems.

Personally I prefer to work with the standard notebook editor interface, but because of the latter problem with source control I like to have a percent-formatted version in parallel.

My feature request: Have an option, either global, per-workspace, or per-notebook, that whenever an .ipynb file is saved, a percent-formatted version of it is created/updated in the background, too. This way the notebook proper can be used for interactive work, but the commits on the percent-formatted version can serve as a readable record of what was done, so if it is necessary to revert changes, it is clear which commit is the right one.

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

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:38
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
DonJayamannecommented, Jun 7, 2021

@venaturum I’ve created an extension that does this (open a Python file and execute as a notebook) today https://github.com/notebookPowerTools/vscode-jupytext Currently only usable in VS Code Insiders.

5reactions
amittleidercommented, Aug 19, 2020

Definitely agree with this. Now that we have the real jupyter feel directly inside of VSCode, we don’t even need to open a browser anymore. The problem is that when VSCode reads percent scripts, the look and feel of the interactive mode is different (and worse) than the new functionality.

We use percent scripts in the repo and open them using Jupyter with Jupytext. Jupytext links the percent script with the ipynb file, just as @allefeld is explaining. It’d be perfect to have this functionality right inside the editor.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Synchronize your Jupyter Notebook with a python (.py) file?
Click the edit button in the lower right hand corner to save. Don't worry too much about the placement- whether this is the...
Read more >
How to config automatic sync Jupyter notebook .ipynb and .py ...
How to config automatic sync Jupyter notebook .ipynb and .py files in VSCode e.g. by using Jupytext · created file jupytext in the...
Read more >
Using at the Command Line - Jupytext documentation
Representing Jupyter notebooks as scripts requires a solid round trip conversion. You don't want your notebooks (nor your scripts) to be modified because...
Read more >
Notebooks in ArcGIS Pro—ArcGIS Pro | Documentation
ArcGIS Notebooks can be used directly in ArcGIS Pro. ... All Python functionality in ArcGIS Pro is available through ArcGIS ... the Save...
Read more >
The Notebook | Query and analyze data - Mode Support
On the right side panel, click the dropdown to select the environment you want to launch a Notebook from, usually either Python 3...
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