Skip to content

Configuring pyrealm#1141

Merged
davidorme merged 7 commits intodevelopfrom
1140-configure-pyrealm
Nov 12, 2025
Merged

Configuring pyrealm#1141
davidorme merged 7 commits intodevelopfrom
1140-configure-pyrealm

Conversation

@davidorme
Copy link
Copy Markdown
Collaborator

@davidorme davidorme commented Nov 7, 2025

Description

This PR:

  • Adds a new pyrealm section to the core configuration that provides instances of pyrealm's PModelConst and CoreConst. These can be configured using the TOML - there is a residual issue that numpy arrays in the pyrealm config cannot currently be serialised, so user configuration of pyrealm is not captured in exported config TOMLs.
  • Updates all of the models that use pyrealm constants classes to use that configuration section and pass those configured constants instances down through models to the functions and methods that require them.
  • Adds a new fixture_pyrealm_config fixture to tests/conftest.py and uses that in all tests that previously used standalone imports of pyrealm constants.

Fixes #1140
Also fixes #697 - which was PlantsModel specific

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
  • Relevant documentation reviewed and updated

@davidorme davidorme linked an issue Nov 7, 2025 that may be closed by this pull request
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.34%. Comparing base (02c73ce) to head (da1fe5d).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1141      +/-   ##
===========================================
+ Coverage    94.33%   94.34%   +0.01%     
===========================================
  Files           70       70              
  Lines         7024     7044      +20     
===========================================
+ Hits          6626     6646      +20     
  Misses         398      398              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@davidorme davidorme changed the title Configure pyrealm Configuring pyrealm Nov 7, 2025
@davidorme davidorme requested a review from sallymatson November 7, 2025 10:14
@davidorme davidorme merged commit 3d8ae81 into develop Nov 12, 2025
13 checks passed
@davidorme davidorme deleted the 1140-configure-pyrealm branch November 12, 2025 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configure pyrealm The PModel constants are currently fixed.

3 participants