Skip to content

Move hydrology over to the new configuration system#1114

Merged
davidorme merged 9 commits intodevelopfrom
1110-move-hydrology-over-to-the-new-configuration-system
Nov 3, 2025
Merged

Move hydrology over to the new configuration system#1114
davidorme merged 9 commits intodevelopfrom
1110-move-hydrology-over-to-the-new-configuration-system

Conversation

@davidorme
Copy link
Copy Markdown
Collaborator

@davidorme davidorme commented Oct 24, 2025

Description

This PR updates the hydrology model for the new configuration system.

  • Swaps out HydroConsts for the new HydrologyConstants
  • Configures off the new CompiledConfiguration object
  • Update the hydrology.model_config to add some value constraints that were previously checked by the model. This is part of a general move to validate configurations before they get anywhere near being used.
  • Updates the tests to match
  • Add a new test_model_config.py that runs the config validation tests that were previously built into model generation test.

There's one hanging issue, which is the embedded hard coded AbioticConsts in _setup.

  • Eventually the settings in that have to come in from the configuration system, but at the moment we can't get there. The main issue is that AbioticSimpleConstants doesn't provide those values and we only use abiotic_simple in the example dataset and tests. So, we need to find decide which way to pass that information in with the new configuration setup. This is all related to a bunch of long standing issues with inheritance of constants classes.
  • For now, I've moved the hardcoding out into the _from_config and added the abiotic_constants as an argument to __init__. That's closer to what will happen in the future, because it is configurable.

Fixes #1110

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 Oct 24, 2025 that may be closed by this pull request
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.69%. Comparing base (2950f93) to head (e97cd0d).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1114   +/-   ##
========================================
  Coverage    94.68%   94.69%           
========================================
  Files           90       90           
  Lines         7887     7872   -15     
========================================
- Hits          7468     7454   -14     
+ Misses         419      418    -1     

☔ 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 merged commit 834a8df into develop Nov 3, 2025
13 checks passed
@davidorme davidorme deleted the 1110-move-hydrology-over-to-the-new-configuration-system branch November 3, 2025 01:20
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.

Move hydrology over to the new configuration system

3 participants