Skip to content
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

In Jupyter notebook, all cell ids change on save. #236

Closed
dtabell opened this issue Sep 17, 2021 · 4 comments
Closed

In Jupyter notebook, all cell ids change on save. #236

dtabell opened this issue Sep 17, 2021 · 4 comments

Comments

@dtabell
Copy link

dtabell commented Sep 17, 2021

This problem means that git diff on a .ipynb file can report many changes even in the absence of any “real” change in the notebook. Aside from the diff noise, it means the file hash changes and git tells me I need to commit the “updated” file.
This issue, opened on 20 January in the JupyterLab repo, is (as of 15 May) now closed, which implies this problem is now fixed. Is it possible to update JupyterLab, or whatever piece lower down that is responsible for this behavior? Or was the problem not truly fixed?

@robnagler
Copy link
Member

It looks like this fix is part of JupyterLab 4.0, which has yet to be released.

The problem is the newest ipython version added cell ids, but jupyterlab wasn't updated to support them so they get regenerated each time. JupyterLab should 4.4, not 4.5.

I don't think there's an easy fix for us.

@dtabell
Copy link
Author

dtabell commented Sep 17, 2021 via email

@robnagler
Copy link
Member

Notebook version 4.5. JupyterLab version 4.0.

This is part of our version hell. We will need to downgrade ipython to match this. It's not as easy as:

python -m pip install --upgrade 'nbformat<5.1.2'

@dtabell
Copy link
Author

dtabell commented Sep 18, 2021

I guess that means for now we

sed -i -e '/"id": /d' *.ipynb

(or similar) before committing our notebooks in JupyterLab.

@robnagler robnagler removed their assignment Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants