qutip / qutip-tutorials

QuTiP Tutorials
BSD 3-Clause "New" or "Revised" License
33 stars 34 forks source link

Run flake8 on notebook code #13

Closed hodgestar closed 2 years ago

hodgestar commented 2 years ago

I had another idea -- we can add a CI check that converts the notebooks to Python scripts (using Jupytext) and then runs flake8 on those scripts.

christian512 commented 2 years ago

I think verifying the codestyle is a good idea. There are tools especially for Jupyter Notebook to do so. E.g.: https://github.com/nbQA-dev/nbQA

This gives us much more flexibility with different tools to run (including formatting the markdown). For automatic verification on GitHub Actions we can use a predefined Action. E.g.: https://github.com/marketplace/actions/flake8-jupyter-notebook

hodgestar commented 2 years ago

nbQA look great -- let's try it.

I will put in a vote against using a pre-build action. This should be a few lines (hopefully) in the CI config and obscuring those behind a pre-built action doesn't seem worth it.

christian512 commented 2 years ago

The check with flake8 was added in https://github.com/qutip/qutip-tutorials/pull/22. Therefore I close this issue.