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
135 stars 18 forks source link

Clean execution counts inside outputs #161

Closed yasirroni closed 1 year ago

yasirroni commented 1 year ago

Fix https://github.com/srstevenson/nb-clean/issues/158 and https://github.com/srstevenson/nb-clean/pull/160

codecov[bot] commented 1 year ago

Codecov Report

Base: 98.07% // Head: 96.95% // Decreases project coverage by -1.12% :warning:

Coverage data is based on head (c206f8a) compared to base (858643b). Patch coverage: 81.81% of modified lines in pull request are covered.

:exclamation: Current head c206f8a differs from pull request most recent head db796b5. Consider uploading reports for the commit db796b5 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #161 +/- ## ========================================== - Coverage 98.07% 96.95% -1.13% ========================================== Files 3 3 Lines 156 164 +8 ========================================== + Hits 153 159 +6 - Misses 3 5 +2 ``` | [Impacted Files](https://codecov.io/gh/srstevenson/nb-clean/pull/161?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://codecov.io/gh/srstevenson/nb-clean/pull/161/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Scott+Stevenson#diff-c3JjL25iX2NsZWFuL19faW5pdF9fLnB5) | `97.61% <81.81%> (-2.39%)` | :arrow_down: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Scott+Stevenson). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Scott+Stevenson)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

yasirroni commented 1 year ago

Done following review. Please review again?

yasirroni commented 1 year ago
Name                       Stmts   Miss  Cover   Missing
--------------------------------------------------------
src\nb_clean\__init__.py      84      2    98%   187-188
src\nb_clean\__main__.py       3      3     0%   3-6
src\nb_clean\cli.py           77      0   100%
--------------------------------------------------------
TOTAL                        164      5    97%

I don't know how your pytest working, so I'm pretty confused on how to test the check.

srstevenson commented 1 year ago

I don't know how your pytest working, so I'm pretty confused on how to test the check.

We use Poetry for managing dependencies and packaging. If you install it following the instructions here then you can run the test suite with poetry run nox -s pytest. If you want to run all the same checks as are run in CI (i.e. formatting checks, linting, and tests) you can run poetry run nox: if that is successful, then CI should also pass when you push to GitHub.

yasirroni commented 1 year ago

I change it to if output.get("execution_count") is not None. What do you thing?

yasirroni commented 1 year ago

Done, The fails come from codecov upload

srstevenson commented 1 year ago

This has been included in nb-clean 2.4.0, which is available from PyPI.