Skip to content
This repository was archived by the owner on Oct 11, 2021. It is now read-only.

fix: remove cell ids from notebooks#497

Merged
redeboer merged 1 commit intomasterfrom
cell-id
Feb 17, 2021
Merged

fix: remove cell ids from notebooks#497
redeboer merged 1 commit intomasterfrom
cell-id

Conversation

@redeboer
Copy link
Copy Markdown
Member

Somehow if a Jupyter notebook contains

  "nbformat_minor": 5

in its top-level structure, instead of

  "nbformat_minor": 4

both nbstripout and Jupyter lab add randomly generated cell IDs to each cell. This is super bothersome for diffs and merge conflicts. Worst part is that the IDs are random which causes a lot of unnecessary file changes.

This PR removes the "id" items and lowers the nbformat_minor. With the current dev set-up (pinned versions of jupyterlab etc) new notebooks will again get "nbformat_minor": 5, but I'm not sure how to work around this. Just something to keep an eye on now.

Somehow if the metadata contains
  "nbformat_minor": 5
instead of
  "nbformat_minor": 4
nbstripout and jupyter lab add randomly generated cell ids to the
cell metadata
@redeboer redeboer added the Bug Something isn't working label Feb 17, 2021
@redeboer redeboer self-assigned this Feb 17, 2021
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 17, 2021

Codecov Report

Merging #497 (0373a7f) into master (88531c7) will decrease coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #497      +/-   ##
==========================================
- Coverage   89.26%   89.20%   -0.06%     
==========================================
  Files          22       22              
  Lines        3334     3334              
  Branches      844      844              
==========================================
- Hits         2976     2974       -2     
- Misses        194      195       +1     
- Partials      164      165       +1     
Flag Coverage Δ
unittests 89.20% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/expertsystem/amplitude/helicity_decay.py 89.57% <0.00%> (-0.78%) ⬇️

@redeboer
Copy link
Copy Markdown
Member Author

Note: I initially suspected "hide-cell" tags or "keep_output", but it's really "nbformat_minor": 5 that causes these IDs.

@redeboer redeboer merged commit 200385d into master Feb 17, 2021
@redeboer redeboer deleted the cell-id branch February 17, 2021 16:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant