Move animals over to the new configuration system#1116
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1116 +/- ##
===========================================
+ Coverage 94.63% 94.70% +0.06%
===========================================
Files 90 90
Lines 7887 7887
===========================================
+ Hits 7464 7469 +5
+ Misses 423 418 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8 tasks
TaranRallings
approved these changes
Nov 2, 2025
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
Mostly this PR is:
However, there is also a deeper change in the model
__init__. The current code looks like this:virtual_ecosystem/virtual_ecosystem/models/animal/animal_model.py
Lines 162 to 181 in 4c9e14b
The model arguments do not require that users provide a set of model constants. The constants are provided internally - the model
__init__creates a brand new set of constants with the appropriate density scaling but using all of the default values. So users can configure the density scaling but cannot configure anything else.My solution here is to just use the existing setting inside the constants configuration section to set the method. I've replaced the
density_scaling_method: str = "madingley"in__init__with a requiredmodel_constantsin_setup. That can then be passed in using_from_config. That also means defining the constants and scaling method in__init__but delaying setting them until_setup: I think this is closer to how these methods should be defined - only attribute definitions in the__init__. With this setup, users can provide a complete configuration and change defaults and it will be respected by the model. At the moment it gets ignored.Fixes #1113
Type of change
Key checklist
pre-commitchecks:$ pre-commit run -a$ poetry run pytestFurther checks