LSSTC-DSFP / LSSTC-DSFP-Sessions

Lecture slides, Jupyter notebooks, and other material from the LSSTC Data Science Fellowship Program
MIT License
296 stars 280 forks source link

nbstripout or auto-formatting #105

Open adrn opened 2 years ago

adrn commented 2 years ago

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?

adamamiller commented 2 years ago

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.

adrn commented 2 years ago

Oh, I should have given a summary:

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.