Swap animal functional group configuration to CSV#1068
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1068 +/- ##
===========================================
- Coverage 95.38% 95.24% -0.15%
===========================================
Files 79 79
Lines 6876 6891 +15
===========================================
+ Hits 6559 6563 +4
- Misses 317 328 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
TaranRallings
left a comment
There was a problem hiding this comment.
This is a graceful solution! I expected it to be far more finicky but this is way better and now I don't have to update 45 different files every time I change the functional group definition. LGTM!
|
Particularly now that the |
|
|
||
| ### Animal functional group definitions | ||
|
|
||
| The `animal_functional_groups.csv` file is a CSV file that defines the animal functional |
There was a problem hiding this comment.
Is this part already updated on the readthedocs.io? I could not see the addition of "Animal functional group definitions" as of now.
There was a problem hiding this comment.
It is there but it is pretty brief: https://virtual-ecosystem.readthedocs.io/en/latest/using_the_ve/example_data.html#animal-functional-group-definitions
We need to link that to a more detailed explanation in the animal model implementation/configuration docs.
There was a problem hiding this comment.
I could've sworn it was not there when I looked at it yesterday 😆. Thanks!
Thanks for streamlining configured paths. I might have more comments later on.
We need to link that to a more detailed explanation in the animal model implementation/configuration docs.
You can find more detailed explanation of functional group attributes in docs/source/virtual_ecosystem/theory/animals/animal_theory.md which we can link to. However we both felt like it fits much better in docs/source/virtual_ecosystem/implementation/animal_implementation.md, so this is in the list of things I need to do.
There was a problem hiding this comment.
I could've sworn it was not there when I looked at it yesterday😆. Thanks!
Ok I realised I probably was not on the latest version, but instead on the 1050-revamp-the-existing-using-the-ve-documentation version. My bad!
|
Just got to go through this PR! This is great progress, thanks @davidorme! A much user friendly approach. So now only a CSV defining AFG is necessary to add as one of the I have a few questions on these for clarification:
Thanks! |
Just to be really pick about
[animals]
functional_group_definitions_path = "/path/to/data.csv"
Nope - the TOML (as above) provides the path of a CSV file to load from. This PR basically moves all of the data that was crammed into TOML format to an entirely separate file in an easier format, and the animal config then just points to that file.
A
|
Description
This PR aligns the configuration of animal and plant functional groups. Both now load functional group definitions from a more user friendly and readable CSV file, which is configured from a single path setting in their config schema. The option to load them from an array of tables in TOML has been removed.
import_functional_groupsfunction has been updated to do wider error checking.[[animal.functional_groups]]syntax and replace it with:AnimalModel.from_configmethod now callsimport_functional_groups.@TaranRallings - there are now two very similar definition files kicking around:
tests/models/animals/data- used inanimalstestingtests/data- fed into the mainconfigfixtures.I suspect we could probably remove one, but wasn't about to try and guess which 😄
Fixes #1067
Type of change
Key checklist
pre-commitchecks:$ pre-commit run -a$ poetry run pytestFurther checks