Show HN: Reactive Jupyter- reactive execution of Python in VSCode https://ift.tt/j2SsQw1
Show HN: Reactive Jupyter- reactive execution of Python in VSCode Hi HN I’ve developed an experimental VSCode extension to keep a Python Kernel in sync with a Python file. (Reactive execution) The extension uses Static Code Analysis to infer dependencies between lines of code. When you modify a line in a file, it will be marked as Stale together with all the lines that depend on it. You can Sync the state with Ctrl+Shift+Enter. In this way, you are always in control. See the Readme for a detailed demo. —------------- The primary limitation of this extension is that it currently relies on Static Code Analysis, which can only do so much. Again, see the Readme for a discussion. This extension is also in PREVIEW. I’m sure there are bugs around. Both in the Static Code Analysis of more obscure Python idioms (even though it’s pretty robust for the simple ones), and in the interaction with the VsCode APIs (lots of edge cases there). —------------- The intended use cases are machine learning, data analysis, scientific computing or any other application that requires scripting or exploratory coding. The most popular setup for these is Jupyter Notebooks, and this extension could be expanded to work with Notebooks too. On the other hand, right now it is very much built around my personal favourite for these workflows. I’ve used Jupyter Notebooks many times, but I’ve never quite liked them for the following reasons: - For the editing experience, nothing really beats a plain Python file. I want to select, copy, and paste all the code I want anywhere, without Cells getting in my way. - Having an output on every cell produces lots of clutter anyway. For most cells, I want to run them once, keep the code there just in case, but don’t run them again. - And then of course, the Reactivity problem: when you modify a cell, there is usually no way to rerun the affected code only. The VSCode Interactive Window makes for a great setup for 1 and 2. My extension fixes 3. —------------- I’ve wanted to have this extension for years. Only now it became possible thanks to a cool new VsCode Jupyter feature, i.e. the ability to send code from an extension directly to a running Python kernel. Even though I’ve developed this primarily for myself, I’d love to know what you think about it! https://ift.tt/Aay7u4x March 20, 2024 at 11:18PM
Komentar
Posting Komentar