Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Jupyter code is draft code. Draft code rarely makes into clean code, because it requires extra tedious effort. Most of us are too overworked to have the time or energy to perform it.

Alternatively one can write exploratory code as unit tests and run them inside an IDE. When the exploration is done, three quarters of the tedious cleanup effort is already done. There are already unit tests. There are already APIs exercised by the unit tests. The code is in much better shape.

The missing two bits:

* No charting support. To the best of my knowledge, neither PyCharm nor VSCode have an output console with HTML support.

* Caching. Some operations take a lot of time. At the extreme, fast.ai style development, where some cells train a model for hours/days. Re-running such code from scratch on every test run is impractical. An opportunity for a library with explicit save/load/cache/checkpoint support.



Vscode has decent Jupyter support with its python plugin. What I really missed my jupyter notebooks was a world class editor with keyboard shortcuts and code completion. So I went the other route, running jupyter notebooks in vscode.

I made a really simple python cli module that would convert from jupyter notebook to python files with runnable cells in vscode, and vice versa.

https://github.com/nojvek/vscode-ipynb-py-converter/blob/mas...

Really upped my game while doing the udacity courses.

Vscode does indeed have a html output console.


Wow! This is insanely cool! You should package this up as a VS Code plugin so more people can use it. At a minimum, please post a license.txt file in your repo so folks can actually use it (MIT or similar is pretty easy and common for something like this, without a license.txt file it's not clear whether others can actually use it and many places that means they can't).


You should check this out https://github.com/nteract/hydrogen


Hydrogen looks very cool! Am I right that hydrogen and the https://github.com/DonJayamanne/vscodeJupyter plugin that nojvek's plugin is designed to work with in that hydrogen shows the plots inline (like Jupyter does) but hydrogen doesn't support markdown? [edit: the biggest difference is that hydrogen is a stand-alone atom-like editor not a vscode plugin]


I usually mark all my repos as MIT but will explicitly add a LICENSE.txt. Thanks


I only recently learned myself that Jupyter notebooks do have code completion, triggered by hitting the tab button - although possibly you were thinking of something more advanced than that. In any case I'll check out your code on github.


Actually, if you activate the 'Hinterland' extension, you don't need to hit tab. And there's a ton of more extensions too. Their Github repo has instructions on how to set up the extensions - https://github.com/ipython-contrib/jupyter_contrib_nbextensi...


This is how I code, exploratory code as unit tests ....

> Alternatively one can write exploratory code as unit tests and run them inside an IDE. When the exploration is done, three quarters of the tedious cleanup effort is already done. There are already unit tests. There are already APIs exercised by the unit tests. The code is in much better shape.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: