Skip to content

Changed litter model to use exact solution for the litter pool size#1001

Merged
jacobcook1995 merged 22 commits intodevelopfrom
979-integration-of-the-litter-model-needs-to-be-improved
Aug 20, 2025
Merged

Changed litter model to use exact solution for the litter pool size#1001
jacobcook1995 merged 22 commits intodevelopfrom
979-integration-of-the-litter-model-needs-to-be-improved

Conversation

@jacobcook1995
Copy link
Copy Markdown
Collaborator

@jacobcook1995 jacobcook1995 commented Aug 18, 2025

Description

This PR changes the litter model to use an exact analytic solution for the pool size with time. The new model approach is in this part of the docs.

While making this change I realised that the way I was averaging nutrient ratios was incorrect. I decided it made most sense to fix that at the same time, but that means that this PR has ballooned in size

@vgro, this fixes the issue of the negative litter pools crashing ve_run when the abiotic model is included. Unfortunately, it still doesn't run, but it's now a soil model error (linked to #536) so that's progress

@hrlai, I've add you as a reviewer but don't worry about looking at the code, if you could sense check the documentation + check that it fits with the models that you are fitting for the parameterisation, that would be great!

Fixes #979, Fixes #991, Fixes #969

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

…atabble with analytic approach to finding final pool values
@jacobcook1995 jacobcook1995 linked an issue Aug 18, 2025 that may be closed by this pull request
@jacobcook1995 jacobcook1995 requested review from hrlai and vgro August 18, 2025 08:30
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.90%. Comparing base (266dbe6) to head (52474f4).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1001      +/-   ##
===========================================
+ Coverage    94.82%   94.90%   +0.08%     
===========================================
  Files           79       80       +1     
  Lines         6511     6616     +105     
===========================================
+ Hits          6174     6279     +105     
  Misses         337      337              

☔ 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.

Copy link
Copy Markdown
Collaborator

@vgro vgro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sensible to me, I cannot comment much on the science

Copy link
Copy Markdown
Collaborator

@hrlai hrlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I've read the theory document only and it makes sense.

@jacobcook1995
Copy link
Copy Markdown
Collaborator Author

jacobcook1995 commented Aug 20, 2025

Great, thanks both of you! I've made the suggested docs changes and will go ahead and merge now

@jacobcook1995 jacobcook1995 merged commit bd49341 into develop Aug 20, 2025
13 checks passed
@jacobcook1995 jacobcook1995 deleted the 979-integration-of-the-litter-model-needs-to-be-improved branch August 20, 2025 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants