Switch core over to new configuration#1103
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1103 +/- ##
===========================================
+ Coverage 94.55% 94.56% +0.01%
===========================================
Files 90 90
Lines 7882 7916 +34
===========================================
+ Hits 7453 7486 +33
- Misses 429 430 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
@jacobcook1995 Do you think you'd have time to look at this before you leave? There are quite a lot of files, but it is basically swapping out configuration settings to maintain the same set of tests. I've edited tests that incorporated config validation, since that now all happens much earlier. |
Collaborator
|
@davidorme if it's ready to review now I can take a look today |
jacobcook1995
approved these changes
Oct 23, 2025
Collaborator
jacobcook1995
left a comment
There was a problem hiding this comment.
LGTM! A few minor comments + queries but nothing that should prevent merging
…github.com/ImperialCollegeLondon/virtual_rainforest into 1101-switch-core-over-to-new-configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR updates the whole of the
coremodel to using the new configuration system.The big changes are:
core.core_componentandcore.gridmodules have been updated to use data provided fromcore.model_configclasses, removing all usage of the oldConfigdictionary.core.model_configmodule has been updated to improve the docstrings and to provide better validation and class structure.soil.model_confighas been updated. I'd been planning to move forward with moving soil config into CSV files and had left a lot of structure out of this file, which is now provided. I still think we should move to CSV, but not within the [META] Replacing the configuration system. #1085 meta PRThe other changes are utility fixes, improvements
CompiledConfigurationcore.model_configclasses since that is one of the key advantages of the new system. Bad configs basically can't be created.Everything else is test fixes:
Model.from_configtests currently throw in a test case with bad config inputs. As noted above - this is no longer a thing under the new system - the configuration classes auto-validate on loading before they even get near afrom_configmethod, so a bad Configuration object is no longer possible. I've propped these tests up for now but those test cases can be retired as models are updated.Fixes #1101
Type of change
Key checklist
pre-commitchecks:$ pre-commit run -a$ poetry run pytestFurther checks