Live data from Hacker News

A Visual Debugger for Jupyter

blog.jupyter.org

41–50 of 74 posts

Re: A Visual Debugger for Jupyter

#42

I'm a programmer, mostly not a data scientist nowadays, mostly working with Python. I have tried Jupyter Lab/Notebook on and off over the last 10 years, and I believe I have now firmly settled on my conclusion: Everyone should aim to minimize the amount of work they do in Jupyter Lab / Notebook. It shocks me a bit to find myself saying that, as it is such a beautiful piece of work. Furthermore the people who wrote it…

[deleted]

Re: A Visual Debugger for Jupyter

#43
post #37

Been wondering about this for a while... How does one "graduate" a notebook to an actual program on a server? Is there an actual standard procedure for that? I'm pretty sure that if your notebook is big enough to debug what's in it you'd be doing everyone a disservice keeping it contained like that.

I generally use the `jupyter nbconvert` command when I have to do something like this.

This can convert a Jupyter notebook into a Python script but unless the notebook has been written with some care (with the intention of converting it into a script later), a lot of manual twiddling will be required.

What I generally do is use Jupyter notebooks when I'm exploring a problem or dataset. When I'm done with the exploration phase, I immediately mark the notebook as deprecated (trying to keep it in sync with code is a nightmare) and link the the relevant source code elsewhere in the project that it was deprecated for.

Databricks does a decent job productionizing their notebooks, and have seen people be quite productive on that platform.

Re: A Visual Debugger for Jupyter

#44
post #37

Been wondering about this for a while... How does one "graduate" a notebook to an actual program on a server? Is there an actual standard procedure for that? I'm pretty sure that if your notebook is big enough to debug what's in it you'd be doing everyone a disservice keeping it contained like that.

https://papermill.readthedocs.io/en/latest/

Papermill and some light container tooling can take you a long way. It gets bonus points because data science folks are quicker to jump into a notebook and debug their own equations than they are a Python module.

Re: A Visual Debugger for Jupyter

#45

I'm a programmer, mostly not a data scientist nowadays, mostly working with Python. I have tried Jupyter Lab/Notebook on and off over the last 10 years, and I believe I have now firmly settled on my conclusion: Everyone should aim to minimize the amount of work they do in Jupyter Lab / Notebook. It shocks me a bit to find myself saying that, as it is such a beautiful piece of work. Furthermore the people who wrote it…

Speaking as a data scientist and not a software engineer, I think Jupyter is incredibly valuable and I've been excited to see it develop pretty quickly in the few years I've been using it. I agree with you that it's not a tool for writing software. It's probably best thought of as a really good REPL. And there are tons of uses cases for just that (at least in my discipline): analyzing an experiment, pulling data from…

I understand what you're saying. I agree that there are situations where it's very useful, and I defer to you as having more recent experience regarding what those are. However, it isn't just the "tasks that I have at hand". Half of my point is that, even in data science contexts, one ought often to minimize the amount of work done in a notebook. To take your scenarios, I agree with "pulling data from a DB and plotting it". But I don't agree with "analyzing an experiment". I may not do data science now, but I did before. "Analyzing an experiment" involves debugging, and it is important that the analysis is correct, and repeatable for publication/distribution. So I do maintain that for any non-throwaway code, everyone is well-served by embracing traditional engineering discipline for the debugging and verification challenges that will inevitably crop up.

Re: A Visual Debugger for Jupyter

#47

I'm a programmer, mostly not a data scientist nowadays, mostly working with Python. I have tried Jupyter Lab/Notebook on and off over the last 10 years, and I believe I have now firmly settled on my conclusion: Everyone should aim to minimize the amount of work they do in Jupyter Lab / Notebook. It shocks me a bit to find myself saying that, as it is such a beautiful piece of work. Furthermore the people who wrote it…

Totally agree, as someone that's jumped back and forth between software engineering & data science. Data science programming already brings out my worst habits - mixing business logic everywhere, using libraries with odd APIs (pandas, matplotlib) => trawling Stackoverflow for code snippets without really understanding them, ugly performance optimizations.

Add poor version control practices and the dawning realization that you don't know whether your code ever worked or just seemed to work because some variable was in scope that shouldn't have been, and it quickly becomes chaos.

Re: A Visual Debugger for Jupyter

#48
post #37

Been wondering about this for a while... How does one "graduate" a notebook to an actual program on a server? Is there an actual standard procedure for that? I'm pretty sure that if your notebook is big enough to debug what's in it you'd be doing everyone a disservice keeping it contained like that.

The fast.ai folks wrote nbdev to help with that. https://github.com/fastai/nbdev

yfcuyrfuyoguyvuytfvty

Re: A Visual Debugger for Jupyter

#50
post #37

Been wondering about this for a while... How does one "graduate" a notebook to an actual program on a server? Is there an actual standard procedure for that? I'm pretty sure that if your notebook is big enough to debug what's in it you'd be doing everyone a disservice keeping it contained like that.

Jupytext [1] has been a good option to keep scripts alongside notebooks. The advantage is that it also keeps both versions synced so you can edit whichever you want (just not at the same time, as the browser will not live update cell contents for you).

[1] https://github.com/mwouts/jupytext

Post reply on HN