Skip to content

Standalone configuration models for abiotic and abiotic simple models#1139

Merged
davidorme merged 6 commits intodevelopfrom
1137-resolve-shared-constants-between-abiotic-and-abiotic-simple-to-allow-configuration
Nov 12, 2025
Merged

Standalone configuration models for abiotic and abiotic simple models#1139
davidorme merged 6 commits intodevelopfrom
1137-resolve-shared-constants-between-abiotic-and-abiotic-simple-to-allow-configuration

Conversation

@davidorme
Copy link
Copy Markdown
Collaborator

@davidorme davidorme commented Nov 7, 2025

Description

This PR restructures the configuration of the abiotic and abiotic_simple models to provide a single standalone configuration for each model. The two models no longer need to supply both abiotic_constants and abiotic_simple_constants. This is important to make the models fully configurable - users need to be able to configure all settings for , for example, the abiotic model from within the [abiotic] configuration section.

It does this by:

  • Creating a small shared constants configuration dataclass (AbioticSharedConstants) that contains only soil and leaf emissivity. These constants are required by both models.
  • The AbioticConstants and AbioticSimpleConstants then build on that shared class to add model specific configuration. For the simple model, that is just initial_net_radiation - there was also a saturation_vapour_pressure_factors field but that was completely unused in the model code. For the full model, there are a lot of other constants.
  • The Abiotic configuration now imports and includes the AbioticSimpleBounds as the [abiotic.bounds] configuration section. So, these bounds are defined in a single place but are now available directly from within a single model config.

The PR then updates the model code to remove all of the parallel usage of abiotic and abiotic_simple constants and just uses the single model configuration.

Closes #1137

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

@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.33%. Comparing base (1a0ea4b) to head (910d3c5).
⚠️ Report is 6 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1139      +/-   ##
===========================================
- Coverage    94.33%   94.33%   -0.01%     
===========================================
  Files           70       70              
  Lines         7029     7024       -5     
===========================================
- Hits          6631     6626       -5     
  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.

…otic-and-abiotic-simple-to-allow-configuration
@davidorme davidorme marked this pull request as ready for review November 7, 2025 10:03
…otic-and-abiotic-simple-to-allow-configuration
Copy link
Copy Markdown
Collaborator

@vgro vgro left a comment

Choose a reason for hiding this comment

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

LGTM

@davidorme davidorme merged commit 02c73ce into develop Nov 12, 2025
13 checks passed
@davidorme davidorme deleted the 1137-resolve-shared-constants-between-abiotic-and-abiotic-simple-to-allow-configuration branch November 12, 2025 09:48
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.

Resolve shared constants between abiotic and abiotic simple to allow configuration.

3 participants