Hybrid dev Jupyter + VS Code & IPython magic autoreload

121 views
Skip to first unread message

oscar6echo

unread,
Aug 23, 2018, 11:45:36 PM8/23/18
to Project Jupyter
There is a lot of work and attention invested in JupyterLab to improve the user experience. It's great !

However there is a type of workflow I have not heard much, but I see very often in my company: People develop Python packages partly in notebooks, partly in IDEs (VS Code, PyCharm, etc). When a piece of code is more or less ok, it moves from a notebook cell to the .py file part of a package (IDEs are better suited to deal with large Python packages). This package is imported in the top cell of the notebook. Because developing is a lot of trial and error, we use the autoreload IPython magic a lot: "%load_ext autoreload, %autoreload 2". Unfortunately this magic works 80% of the time. If the package has a new file of a class a new method typically, it won't work. Then a dev has to restart the kernel.

My question is: How difficult would it be to create an "%autoreload 3" that would work 100% of the time ?
Has anybody else got this problem ?
Does anybody else use Jupyter and and IDE in parallel ? If so any tip ?

Thx

Matthias Bussonnier

unread,
Aug 24, 2018, 12:14:19 PM8/24/18
to jup...@googlegroups.com
> My question is: How difficult would it be to create an "%autoreload 3" that would work 100% of the time ? 

It's probably really hard to really reach 100%, especially when code rely on C-extension package like NumPy. 
We'll be happy to review and merge PR on autoreload, but someone need to do the work, and figure out how to reload or fix the reload case you are interested in. 
-- 
Matthias


--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/64d2de0c-cda6-46b8-9cd9-82706c2a014d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

oscar6echo

unread,
Sep 2, 2018, 4:13:44 PM9/2/18
to Project Jupyter
I wrote IPython Issue#11281 (!) to give and example and propose a fix to solve at least part of the problem.
I can write the PR if necessary ?
Reply all
Reply to author
Forward
0 new messages