Live data from Hacker News

A Visual Debugger for Jupyter

blog.jupyter.org

71–74 of 74 posts

Re: A Visual Debugger for Jupyter

#71
post #68

Earlier quoted context omitted.

With the greatest possible respect, I suspect that you are still on the path towards getting really comfortable with git. I hope this doesn't come across as arrogant or presumptuous. What I suspect, is that you are at a stage which everyone passes through, where the act of "making a commit" feels permanent. You know that there are ways to change history, but it feels like they are going to be a huge distraction from…

Thanks ... I take your point .... but it's not really about being comfortable with git. It's more about what kind of activity you are doing. When I'm an exploratory process with Jupyter it's iterative with a feedback cycle that is almost subsecond. I often have 3 - 4 versions of the algorithm I am exploring visible at the same time in different cells. I'm using autocomplete and interactive evaluation continuously to…

Right, fair enough. Especially helpful to have that iterative feedback with plots. I guess I'm just saying, have a workflow for moving that code into a version-controlled python package as you get happy with it. (I've given some instructions on how to work with your own python packages in a notebook in anothetr comment in this subthread). Now that I've fully embraced my notebookless workflow I've been using the following for plots in a traditional ipython shell:

  import matplotlib
  matplotlib.use("Qt5Agg")
But yes, even I might start up a notebook to iteratively refine a plot! And the HTML table output for dataframes is perfect also.

Re: A Visual Debugger for Jupyter

#72

Earlier quoted context omitted.

Yes, absolutely. What you describe is Django's `manage.py shell_plus`, which does not use a notebook. So not to be argumentative, but to be clear about this discussion, I'm going to say that your comment is 70% irrelevant, since using an interactive REPL is routine in python development. However, it is 30% relevant, because retrieving and archiving the code you ran is going to be much more convenient in a notebook th…

On reflection, I'm not even sure that the notebook is that much of an advantage over shell-based ipython for archiving the commands. One problem is with a notebook, you have less idea what you've actually executed: you just have a bunch of code sitting in cells in a web app. Whereas the shell UX is extremely simple/linear: if a command is in ipython history, then you executed it.

yeah, but sometimes you want to execute snippet 12 4 times then using a variable derived from that go back to snippet 8 etc.

notebooks are about non-linear execution

sure, there's enough rope to hang the whole neighborhood in that, you can totally f things up with no chance of recovery by doing that, or end up with data you have no idea how you got at and no way to re-trace 100% deterministically your steps

but if you have some discipline, stick to read-only-wrt-db, and you just delete whole notebook when things stop making any sense, it's... magical to have all that power and freedom at you finger tips, without having to keep much stuff in your working memory since you can dump it in a var or cell anytime, and mix your text notes through the code too!

It's not for everyone, but I love this beautiful chaos :)

Re: A Visual Debugger for Jupyter

#73
post #72

Earlier quoted context omitted.

On reflection, I'm not even sure that the notebook is that much of an advantage over shell-based ipython for archiving the commands. One problem is with a notebook, you have less idea what you've actually executed: you just have a bunch of code sitting in cells in a web app. Whereas the shell UX is extremely simple/linear: if a command is in ipython history, then you executed it.

yeah, but sometimes you want to execute snippet 12 4 times then using a variable derived from that go back to snippet 8 etc. notebooks are about non-linear execution sure, there's enough rope to hang the whole neighborhood in that, you can totally f things up with no chance of recovery by doing that, or end up with data you have no idea how you got at and no way to re-trace 100% deterministically your steps but if yo…

OK, fair enough!

All of which does seem to paint a picture of a programming environment which is handy for ad-hoc interventions and graphical/audio/video/HTML output but highly unsuitable for organized development of a code base (even a small one), highly unsuitable for systematic debugging, and highly unsuitable for beginners learning to program beyond their first baby steps (as @cycomanic points out elsewhere in this discussion).

Re: A Visual Debugger for Jupyter

#74
post #33

When will jupyter have "highlight and execute" functionality? The cell concept is fine, but I'm constantly copy pasting snippets of code into new cells to get that "incremental" coding approach...

So, I went looking for the answer to this because in the past I've installed the scratchpad extension by installing jupyter_contrib_nbextensions, but those don't work with JupyterLab because there's a new extension model for JupyterLab that requires node and npm.

Turns out that with JupyterLab, all you have to to is right-click and select "New Console for Notebook" and it opens a console pane below the notebook already attached to the notebook kernel. You can also instead do File > New > Console and select a kernel listed under "Use Kernel From Other Session".

The "New action runInConsole to allow line by line execution of cell content" "PR adds a notebook command `notebook:run-in-console`" but you have to add the associated keyboard shortcut to your config yourself; e.g. `Ctrl Shift Enter` or `Ctrl-G` that calls `notebook:run-in-console`. https://github.com/jupyterlab/jupyterlab/pull/4330

"In Jupyter Lab, execute editor code in Python console" describes how to add the associated keyboard shortcut to your config: https://stackoverflow.com/questions/38648286/in-jupyter-lab-...

Post reply on HN