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

Simplify the jupyter kernelspec setup #247

Merged
merged 3 commits into from
Jun 6, 2024

Conversation

davidorme
Copy link
Collaborator

@davidorme davidorme commented Jun 5, 2024

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

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist

  • Make sure you've run the pre-commit checks: $ pre-commit run -a
  • All tests pass: $ poetry run pytest

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@davidorme davidorme linked an issue Jun 5, 2024 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Jun 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@AmyOctoCat AmyOctoCat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

Copy link
Collaborator

@j-emberton j-emberton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@davidorme
Copy link
Collaborator Author

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: astral-sh/ruff#8800

@davidorme davidorme merged commit 2ac07fb into develop Jun 6, 2024
9 checks passed
@davidorme davidorme deleted the 246-simplify-the-jupyter-kernelspec-setup branch June 6, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Simplify the jupyter kernelspec setup
4 participants