3 ms·
I think the Atom editor + Hydrogen plugin for running interactive Python sessions inline with the code is still unmatched by anything available in VS Code. This
by ddhhyy 4y ago
I think the Atom editor + Hydrogen plugin for running interactive Python sessions inline with the code is still unmatched by anything available in VS Code. This setup is what I migrated to when I ditched Matlab for the "scientific Python" stack, and I'm still here.
Multiple concurrent kernels, the ability to connect any .py file to any running kernel, sharing variables and imports across multple .py files, inline matplotlib output that persists on-screen and inline with the code even when running other code cells... the list goes on. I'm really fond of this setup. I use it daily--it's an essential component of my day job--and intend to do so for the foreseeable future. VS Code does seem to be the way of the future but there have just been too many friction points for me to leave Atom.
- __ryan__ 4y agoWhat’s preventing this from being done in VSCode? Other than it hasn’t yet? I don’t think it ticks every box for you, but have you tried Jupyter Notebooks in VSCode[0]? [0] https://code.visualstudio.com/docs/datascience/jupyter-notebooks https://code.visualstudio.com/docs/datascience/jupyter-noteb...
- kylebarron 4y agoVSCode doesn't support an API to put outputs inline in the text editor. IIRC there have been longstanding feature requests for it but it would probably have a performance hit. The closest thing is having a separate output window on the right side
- satvikpendem 4y agoIs that not what Jupyter notebook support is about? I can run something and see the output below the code.
- kylebarron 4y agoBut with Hydrogen you could do that in a regular Python script without needing to create a notebook or think in terms of cells. There's an example of this in the Hydrogen readme: https://github.com/nteract/hydrogen#hydrogen- https://github.com/nteract/hydrogen#hydrogen-
- taink 4y agoI don't think it's an API problem, because Scala Worksheets work in VSCode[0] (and in most editors actually). [0] https://scalameta.org/metals/docs/editors/vscode/#worksheets https://scalameta.org/metals/docs/editors/vscode/#worksheets
- kylebarron 4y agoI think you're referring to the "inlay hint" API, which is different from being able to visualize any HTML in the current text editor, like Hydrogen is able to: https://cloud.githubusercontent.com/assets/13285808/20360886/7e03e524-ac03-11e6-9176-37677f226619.gif https://cloud.githubusercontent.com/assets/13285808/20360886...
- __ryan__ 4y agoVSCode’s Jupyter Notebooks is slightly different from Hydrogen in that it’s basically a MarkDown document with executable code blocks (cells) in the text editor that show their output in the text editor. Again, not exactly the same as Hydrogen but there’s definitely some overlap in use cases and VSCode’s Jupyter Notebooks is pretty good. You should give it a shot and see if it’s a viable replacement for what you were using Hydrogen for. This showcases the UI a bit if I’m not being clear: https://code.visualstudio.com/learn/educators/notebooks https://code.visualstudio.com/learn/educators/notebooks
- kylebarron 4y agoThat's exactly my complaint though. I don't want to work in a notebook frame of mind. I don't want to have to demarcate `#%%` every time I run code (especially because you'd need to scroll down to put another `#%%` where the code you're running should stop.) As I noted in a sibling comment, I wrote a quick extension [0] that makes this easier by automatically inferring code blocks, but VSCode Jupyter is lacking in other ways: you can't have multiple Jupyter kernels running at the same time and it doesn't show you runtime completions in the editor (necessary for compiled packages without type support). [0]: https://github.com/kylebarron/vscode-jupyter-python https://github.com/kylebarron/vscode-jupyter-python
- kylebarron 4y agoI completely agree. For the last couple years I've used VSCode for everything _except_ interactive Python development because Atom + Hydrogen is just too good. I'm giving VS Code + its Jupyter extension a shot for now. It's significantly worse than Hydrogen, but I tried to make it a little less bad with a quick extension to auto-infer code blocks [0]. [0]: https://github.com/kylebarron/vscode-jupyter-python https://github.com/kylebarron/vscode-jupyter-python
- wnolens 4y agoSame! I live in this ecosystem (Atom + Hydrogen python sessions) on a daily basis. But rather than for "science", i use it for devops productivity (scrape logs, query dbs, automate mitigations) and some low-key data analysis. It's breathed life into my love for programming, given how easy it is to just start executing code (sometimes I just use it as a calculator app since it's that easy and accessible) I tried VSCode's equivalent plugin, but the UX was nowhere near as nice.