srstevenson / nb-clean

Clean Jupyter notebooks for version control. Remove metadata, outputs, and execution counts with Git and pre-commit support.
https://pypi.org/project/nb-clean
ISC License
137 stars 19 forks source link

Add preserve execution counts option #223

Closed thatlittleboy closed 11 months ago

thatlittleboy commented 11 months ago

Closes #221 .

The implementation is fairly straightforward. I added the preserve_execution_counts option for add_filter, check and clean subcommands.

Just one thing to check:

codecov[bot] commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (2cfea99) 99.41% compared to head (e552d25) 99.44%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #223 +/- ## ========================================== + Coverage 99.41% 99.44% +0.02% ========================================== Files 3 3 Lines 172 180 +8 ========================================== + Hits 171 179 +8 Misses 1 1 ``` | [Files](https://app.codecov.io/gh/srstevenson/nb-clean/pull/223?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Scott+Stevenson) | Coverage Δ | | |---|---|---| | [src/nb\_clean/\_\_init\_\_.py](https://app.codecov.io/gh/srstevenson/nb-clean/pull/223?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Scott+Stevenson#diff-c3JjL25iX2NsZWFuL19faW5pdF9fLnB5) | `100.00% <100.00%> (ø)` | | | [src/nb\_clean/cli.py](https://app.codecov.io/gh/srstevenson/nb-clean/pull/223?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Scott+Stevenson#diff-c3JjL25iX2NsZWFuL2NsaS5weQ==) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

srstevenson commented 11 months ago

I've released nb-clean 3.1.0, which includes this feature, to PyPI.

thatlittleboy commented 11 months ago

Awesome, thanks @srstevenson