-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
T260: Add a pre-commit hook for cleaning ipynb files (#260)
* Add a pre-commit hook for cleaning ipynb files Add a Python script that cleans ipynb files by resetting execution counts, removing outputs, and removing metadata. Add the script as a pre-commit hook. This commit also contains the results of running the hook on all the existing ipynb files in the repository. * Include path name when cleanipynb.py fails * Improve cleanipynb hooks Extend cleanipynb with an argument that allows leaving output cells as-is, and pass this argument when processing notebook files that are immediate descendents of the notebooks/ folder so that example outputs are retained but metadata are removed. Another hook runs for notebooks in the notebooks/helpers/ folder so that both outputs and metadata are removed. * Incorporate feedback 1. Reset execution counts to "null" when removing outputs and to an increasing integer series starting from one when leaving outputs. 2. Checkout all example notebooks (notebooks\*.ipynb) from develop to make sure no other changes beyond the final cleanipynb behavior were made. 3. Fix a bug in .pre-commit-config.yml where both cleanipynb hooks would be run for files in the notebooks\helpers\ folder. * Fix documentation build Link to the docs for the currently-running version of Python during the doc build.
- Loading branch information
1 parent
7f9a44e
commit 2967f11
Showing
13 changed files
with
108 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.