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

Enforcing clearing of the notebook output #94

Open
christian-oreilly opened this issue Oct 31, 2024 · 0 comments
Open

Enforcing clearing of the notebook output #94

christian-oreilly opened this issue Oct 31, 2024 · 0 comments
Assignees
Labels
DevOps enhancement New feature or request

Comments

@christian-oreilly
Copy link
Collaborator

As this project will rely a lot on notebooks and notebooks are notoriously bad for doing git diffs, we need to implement coding rules that make their review manageable. Here is a comment from @scott-huberty that I think is worth investigating and implementing:

I came across an interesting idea for managing Jupyter notebooks in Git.

Use a pre-commit hook* to clear the output of the jupyter notebooks in your repository each time you make a commit. Something like:

jupyter nbconvert --clear-output --inplace .ipynb

That way, git only has to deal with the git diff for actual changes to the jupyter notebook python/markdown cells, not their output.

*Pre-commit is a DevOps python package for doing things like automatically enforcing style/linting rules before comitting. If the pre-commit fails, it will prevent you from making the commit. MNE-Python usees it so that contributors/devs follow basic style guidelines before opening up a PR (i.e. you don't have to dedicate an entire CI to catching flakes).

further reading on pre-commit: https://stefaniemolin.com/articles/devx/pre-commit/behind-the-scenes/

@bcalford Could you have a look into this when convenient?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DevOps enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants