-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto refresh notebook cell after paired file been modified #406
Comments
Hello @zhuoqiang , thanks for discussing this. Right now the synchronisation between the two files only occurs when 1) you save the notebook in Jupyter or 2) you reload the notebook in Jupyter (ipynb is updated in memory only) or 3) you run Could you describe how you would see this automatic refresh? Do you want to auto update the
Sure we could think of that. Currently there is |
My workflow is like this:
jupytext does a great job to sync and update the notebook file when paired python source file changed, however I still have to do step 2 and step 3 manually. Ideally, step 2 could be done automatically, that is trigger a reload in jupyter when the paired python file been changed. |
I am also looking for this feature. This could be impossible to achieve in Notebook but JupyterLab might has some advance feature to support this? Basically I want to use Vim as my editor and Jupyter as my REPL, using Jupytext as the bridge. So I want to minimize the time to complete an iteration of REPL between vim <-> jupytext <-> notebook with the least interruption and keypress as possible. |
Hello, yes I agree it would be great to have this auto-refresh. Actually my notebooks also take a long time to refresh, just because they are too heavy... if we found a way to reload only the text version, and do the merge in the brower, that could be way faster. For this, we would need to 1) find a way to load the input-only version of the notebook and 2) do the merge in TypeScript or Javascript. At the moment, 2) is done with combine.combine_inputs_with_outputs in Python, and I am not sure I'd know how to write that in TS/JS... |
I came up with a super hacky approach to this problem and created a Python package. The idea is to run a process that watches for .py file changes and refreshes browser window when they happen. It also uses JS to scroll to changed cell and execute it. I use a browser window spawned with Selenium, but maybe it's possible to do this without it. |
Thank you @festeh for sharing this. I will have a look soon! |
This package that use |
I've made this vim keybinding that (1) save the python file (2) sync it with the Jupyter notebook (3) shift focus on the browser which contains the notebook (4) refresh the page. It uses hyperland controller but the concept should be the same whether WM you are using:
|
Also, check out jupynium |
right now, when notebook cell changed, the paired file will be auto updated, but not vise versa.
It would be great if jupytext could update the modified cells when paired file been updated, and even auto re run the cell (configurable).
The text was updated successfully, but these errors were encountered: