ImperialCollegeLondon / pyrealm

Development of the pyrealm package, providing an integrated toolbox for modelling plant productivity, growth and demography using Python.
https://pyrealm.readthedocs.io/
MIT License
21 stars 8 forks source link

Simplify the jupyter kernelspec setup #247

Closed davidorme closed 4 months ago

davidorme commented 4 months ago

Description

This removes the redundant step of creating a specific pyrealm_python3 kernel for Jupyter notebooks and falls back on the poetry shell and poetry run commands updating the Jupyter kernel specs when run.

I have also added jupytext --pipe black as a pre-commit hook on the docs/source tree to add automatic black formatting of code cell contents, and also ensure consistent formatting of {code-cell} directives (omits the default language)

There is one downside of this, which is that black insists on stripping out semi-colons, which are a recognized (but hacky) way to suppress the printing of matplotlib function return values.

Fixes #246

Type of change

Key checklist

Further checks

codecov-commenter commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.23%. Comparing base (050c517) to head (7579dd5). Report is 122 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #247 +/- ## ======================================== Coverage 95.23% 95.23% ======================================== Files 28 28 Lines 1701 1701 ======================================== Hits 1620 1620 Misses 81 81 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

davidorme commented 4 months ago

Just to note that this retains black for one pre-commit hook. There doesn't seem to be an equivalent approach for using ruff with jupytext at present. See: https://github.com/astral-sh/ruff/issues/8800