Live data from Hacker News

Nbterm: Jupyter Notebooks in the Terminal

blog.jupyter.org

61–70 of 76 posts

Re: Nbterm: Jupyter Notebooks in the Terminal

#61

The web interface was the main reason I never really used the tool for more than a few test runs. Writing code in the browser combines bad usability and performance with a lack of useful dev tools. Which brings me to the question whether I can edit the code in a text editor as well or I have to write it as shown in the animation. It would be really helpful if there was a shortcut to open the current (code) section in…

Use the qt-console, best of both worlds.

qt-console is great, but it's not a notebook, ie. you don't have cells you can go back to and edit. It's more of a classic console, with great readline emulation and ability to display images easily.

Re: Nbterm: Jupyter Notebooks in the Terminal

#62
post #47
post #42

Earlier quoted context omitted.

So Notebook Ninja has a flag that means write the notebook and its calculated cells to an html page or some other form that would capture a snapshot at a particular step in the process, and thus be suitable to be served by a web server without being "re-executed" ? Why doesn't nbterm allow for production execution of code ? I thought that was the point of its existence, just that they are done in an terminal window r…

In essence, yes. Ninja is based around the idea of reproducable science: a given execution of a notebook is immutable and accessible consistently. It writes out cell outputs depending on their mimetype (this is included in Jupyter Notebook metadata). It writes out all declared variables, per-cell, and makes them accessible in several formats (for pre-alpha, as JSON objects). It then exposes all of these via our web s…

I'm glad to see that you can link to the execution of a particular cell. Just to clarify, if the cell had the execution for the Age of a particular person, I don't know if the link to the cell is of the age of that person as of the particular day and time when it was executed, or if is stored in an unevaluated form, the execution would yield an age dependent upon the calculation and using "Now" as the value that is compared to the Date of Birth to find out what the age may be. (IE: is the "NOW" evaluated lazily to the date+time of execution, and thus the age will change as time passes) OR (is the "NOW" evaluated eagerly to the date+time of when the execution first occurs, and the value of the age of the person as of that date+time is stored unchanging as the value of the AGE cell ?

Re: Nbterm: Jupyter Notebooks in the Terminal

#63
post #45
post #43

Slightly tangent, but has anyone figured out a good solution for version controlling jupyter notebooks? The closest thing that we've found has been to use the notebook percent format in a simple .py file [0][1]. It plays with git much nicer than an .ipynb and it is still interactive enough for rapid prototyping. However, it would be nice to have some first-class support from Jupyter on this. [0] https://jupytext.read…

You can configure so they don't save their output, then the ipynb diffs will be readable.

Makes me wonder if you could split an ipynb into an in and out file, then add /*.out to .gitignore.

Re: Nbterm: Jupyter Notebooks in the Terminal

#64

Very cool to see this – but will only be successful with great terminal plotting tools. The ones the author mentions like the matplotlib interface clearly won't do[0] due to lack of resolution A perfect use case for unicode plotting [1] (shameless plug) [0] https://github.com/domitry/matascii [1] https://github.com/olavolav/uniplot

Kind of agree, but I often use Jupyter just to capture the command history and its (textual) output. For someone like me this is still useful even without the graphical part of Jupyter.

Re: Nbterm: Jupyter Notebooks in the Terminal

#65
post #43

Slightly tangent, but has anyone figured out a good solution for version controlling jupyter notebooks? The closest thing that we've found has been to use the notebook percent format in a simple .py file [0][1]. It plays with git much nicer than an .ipynb and it is still interactive enough for rapid prototyping. However, it would be nice to have some first-class support from Jupyter on this. [0] https://jupytext.read…

I think jupytext is already as close to "first-class" support as you're going to get. Personally, I'd be happy to see the project included with Jupyter, but you'll have to pester the Jupyter devs for that ;-)

Re: Nbterm: Jupyter Notebooks in the Terminal

#66

The web interface was the main reason I never really used the tool for more than a few test runs. Writing code in the browser combines bad usability and performance with a lack of useful dev tools. Which brings me to the question whether I can edit the code in a text editor as well or I have to write it as shown in the animation. It would be really helpful if there was a shortcut to open the current (code) section in…

For editing notebooks in vim, I've created https://github.com/goerz/jupytext.vim. Note that this does not allow to run any cells, it just edits the inputs.

The motivation behind this was to have some basic interaction with existing ipynb files on a remote server without having to run the jupyter server (and set up port forwarding etc.) It's worth noting that the `jupytext.vim plugin is most useful if you're actually not running `jupytext` within jupyter; If you are, you could just directly open the .py or .md files linked to any .ipynb in your editor.

I've used `jupytext.vim` to edit existing notebooks and then run them through `jupyter nbconvert --to notebook --execute`. It's also great for refactoring: moving code from a notebook files into a module, between notebooks, or to create a new notebook as a variation of an existing one.

Re: Nbterm: Jupyter Notebooks in the Terminal

#67

Very cool to see this – but will only be successful with great terminal plotting tools. The ones the author mentions like the matplotlib interface clearly won't do[0] due to lack of resolution A perfect use case for unicode plotting [1] (shameless plug) [0] https://github.com/domitry/matascii [1] https://github.com/olavolav/uniplot

Gnuplotlib can do it just fine. https://github.com/dkogan/gnuplotlib/

Re: Nbterm: Jupyter Notebooks in the Terminal

#68
post #43

Slightly tangent, but has anyone figured out a good solution for version controlling jupyter notebooks? The closest thing that we've found has been to use the notebook percent format in a simple .py file [0][1]. It plays with git much nicer than an .ipynb and it is still interactive enough for rapid prototyping. However, it would be nice to have some first-class support from Jupyter on this. [0] https://jupytext.read…

Until recently, I also thought this was a major problem. My old solution was to always pair .ipynb files with proper .py modules of the same name, so the .ipynb always starts with `%run foo.py` and just calls functions. However, I recently started using VSCode Insiders the preview release of VSCode, which has amazing support for Jupyter notebooks in the editor. You can use your normally configured linters, auto-forma…

I've been using the VSCode Insider's release as well and have been loving it and the new native notebook features for all the reasons you've listed already.

That's an interesting solution. I believe this is similar to what Joel Grus does [0], except %s/jupyter/ipython.

[0] https://www.youtube.com/watch?v=7jiPeIFXb6U

Re: Nbterm: Jupyter Notebooks in the Terminal

#69
post #65
post #43

Slightly tangent, but has anyone figured out a good solution for version controlling jupyter notebooks? The closest thing that we've found has been to use the notebook percent format in a simple .py file [0][1]. It plays with git much nicer than an .ipynb and it is still interactive enough for rapid prototyping. However, it would be nice to have some first-class support from Jupyter on this. [0] https://jupytext.read…

I think jupytext is already as close to "first-class" support as you're going to get. Personally, I'd be happy to see the project included with Jupyter, but you'll have to pester the Jupyter devs for that ;-)

I would love to see that as well, I'm wondering what has stopped them from integrating it already... Maybe there's room for some contributions from the community here :)

Re: Nbterm: Jupyter Notebooks in the Terminal

#70
post #43

Slightly tangent, but has anyone figured out a good solution for version controlling jupyter notebooks? The closest thing that we've found has been to use the notebook percent format in a simple .py file [0][1]. It plays with git much nicer than an .ipynb and it is still interactive enough for rapid prototyping. However, it would be nice to have some first-class support from Jupyter on this. [0] https://jupytext.read…

https://nbdev.fast.ai/

Could you share some of your experience with nbdev? I'm a huge fan of what the fastai team has been doing and I've tried nbdev, but I haven't been convinced yet. Particularly with the pull request experience, it's not very easy to do code reviews.

FWIW my team uses bitbucket and the PR experience is significantly worse than github/gitlab unfortunately.

Post reply on HN