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
142 stars 19 forks source link

Add support for preserving cell outputs #136

Closed srstevenson closed 2 years ago

srstevenson commented 2 years ago

Cell outputs can be preserved by passing the -o/--preserve-cell-outputs flag to the check, clean, and add-filter subcommands.

Thanks to @yasirroni for the initial implementation!

Closes #134.

codecov[bot] commented 2 years ago

Codecov Report

Merging #136 (02c2f6e) into main (a1c3b37) will increase coverage by 0.08%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #136      +/-   ##
==========================================
+ Coverage   97.87%   97.95%   +0.08%     
==========================================
  Files           3        3              
  Lines         141      147       +6     
==========================================
+ Hits          138      144       +6     
  Misses          3        3              
Impacted Files Coverage Δ
src/nb_clean/__init__.py 100.00% <100.00%> (ø)
src/nb_clean/cli.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

yasirroni commented 2 years ago

Thanks.

Anyway, if you want to make your test more complex, maybe you can add a combination of parameters? Something like preserve metadata and outputs at the same time.