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

Look into nbstripout to auto clear notebook output #110

Open
pllim opened this issue Dec 15, 2019 · 7 comments
Open

Look into nbstripout to auto clear notebook output #110

pllim opened this issue Dec 15, 2019 · 7 comments
Assignees

Comments

@pllim
Copy link
Member

pllim commented Dec 15, 2019

All notebooks (including the solutions) should have outputs cleared before being committed to the repo. Any "output" that should not be cleared should be "hardcoded" as markdown text in the notebooks. This is because generated plots in particular eats up unnecessary storage space and is impossible to view as diff.

@adrn
Copy link
Member

adrn commented Dec 17, 2019

If you have nbstripout installed, this is the scary git command to apply retroactively:

git filter-branch -f --index-filter '
    git checkout -- :*.ipynb
    find . -name "*.ipynb" -exec nbstripout "{}" +
    git add . --ignore-removal
'

@adrn
Copy link
Member

adrn commented Dec 17, 2019

Ah, I take it back - that will also remove the cell metadata (i.e. "raises-exception" tags)! Hmm...

@pllim
Copy link
Member Author

pllim commented Dec 17, 2019

@adrn , I don't mean clean the git history. I meant this for more like a cleaner repo going forward.

@pllim
Copy link
Member Author

pllim commented Dec 17, 2019

Does "clear all outputs" also clear the "raises-exception" tags? 😱

@adrn
Copy link
Member

adrn commented Dec 17, 2019

I don't mean clean the git history. I meant this for more like a cleaner repo going forward.

But then we're stuck with the already large, current size of the repo...

Does "clear all outputs" also clear the "raises-exception" tags? 😱

No, it shouldn't!

@pllim
Copy link
Member Author

pllim commented Dec 17, 2019

I think it is easier to squash and force push to master than to do some filter-branch magic. 🔥

@pllim
Copy link
Member Author

pllim commented Dec 24, 2019

@kelle kelle changed the title MNT: Clear generated content off notebooks Look into nbstripout to auto clear notebook output Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants