Fixes to Biomass draft#1494
Fixes to Biomass draft#1494davidorme merged 1 commit into1482-feature-branch-for-biomass-related-functionalityfrom
Conversation
|
@sallymatson I think there are some things about the internal representations that can be made more efficient, but this feels to me like it's shaking down into something fairly solid. I also think some of the code repetition can be reduced, but I'm going to worry about that later. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1482-feature-branch-for-biomass-related-functionality #1494 +/- ##
=========================================================================================
- Coverage 94.99% 94.99% -0.01%
=========================================================================================
Files 72 72
Lines 7790 7787 -3
=========================================================================================
- Hits 7400 7397 -3
Misses 390 390 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sallymatson
left a comment
There was a problem hiding this comment.
All looks sensible to me.
A bit hard to get my head around everything to give a 100% full review, but I trust the details etc and I agree that it's moving in a great direction.
|
Can you just clarify what you mean by this? "Fixes a stupid mistake: the new BiomassTissue classes should not extract turnover - the biomass carbon is untouched by turnover, that's the whole point." |
|
Yup - I've updated the PR description. |
fccbf75
into
1482-feature-branch-for-biomass-related-functionality
Description
This PR:
Fixes a stupid mistake: the new BiomassTissue classes should not extract turnover - the biomass carbon is untouched by turnover, that's the whole point. So the
tissue_turnoverandextract_turnovermethods are removed and collapse back into a singleget_turnovermethod that returns the nutrient turnover losses for inclusion in the whole stem nutrient balancing.ETA: To clarify - I had setup the
BiomassTissue.extract_turnoverabstract method description and then the implementations in the subclasses to actually remove carbon and nutrient masses from the Tissue. This isn't what happens in turnover - a quantity of carbon is allocated to replace old tissue but the tissue mass is maintained. We need to know those masses to pass turnover into the correct pools but the tissue biomasses are unchanged. The method does also need to record the nutrient loss so that the stoichiometric balance of the individual can be resolved after all allocation has occurred.Updates the functionality of
elements_needed_for_growth. Back in Stoichiometry this just reported the elemental masses for nutrient balancing - however with Biomasses it makes more sense for this function to also be responsible for adding growth allocation to the carbon biomasses and similarly increasing nutrient allocations to tissues. This function also returns the new nutrient allocation for inclusion in whole stem element balancing. The method is renamedapply_growth.These new BiomassTissue methods are now called by the relevant functions in the Biomasses class and the tests are updated to cover the new functionality and naming.
Fixes #1493
Type of change
Key checklist
pre-commitchecks:$ pre-commit run -a$ poetry run pytestFurther checks