You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my own projects with tutorials and jupyter notebooks, I like to use pre-commit to run nbstripout to remove notebook metadata and cell output to clean up git diffs and the version control history. I also now use black (again with pre-commit) to apply auto-formatting to the notebook cells.
Would you be open to a PR that sets this up for the Session16 notebooks?
The text was updated successfully, but these errors were encountered:
We also post solutions in the repository along with the notebooks. I'm not familiar with these tools (though they sound like they would remove lots of headaches for our program), but I want to be sure that in a notebook that has solutions - where it's essential to see the output - we don't lose anything.
nbstripout will remove metadata and output from notebooks, but it's possible to set directories and glob patterns to exclude.
black auto-formats code in a consistent, pep8-compliant way. I don't love all of its choices, but it removes the need to think about code formatting. (As you might expect, it can be a divisive tool and has led to many debates!)
pre-commit is a way of automatically running things at the git commit stage, so it provides a way of running nbstripout and black to clean up and reformat notebooks before they even get committed to a repo.
To start, we could try just enabling it for the non-solution notebooks in Session16?
I was also thinking it might make sense to make each session its own repository within the LSSTC-DSFP organization rather than a subfolder (cloning the repo takes a long time!), which would allow for more fine-grained control over testing and repository infrastructure (installation requirements, CI, etc.), but just a thought.
In my own projects with tutorials and jupyter notebooks, I like to use pre-commit to run nbstripout to remove notebook metadata and cell output to clean up git diffs and the version control history. I also now use black (again with pre-commit) to apply auto-formatting to the notebook cells.
Would you be open to a PR that sets this up for the Session16 notebooks?
The text was updated successfully, but these errors were encountered: