Skip to content

Add phosphorus to litter model#539

Merged
jacobcook1995 merged 11 commits intodevelopfrom
512-litter-phosphorus
Sep 10, 2024
Merged

Add phosphorus to litter model#539
jacobcook1995 merged 11 commits intodevelopfrom
512-litter-phosphorus

Conversation

@jacobcook1995
Copy link
Copy Markdown
Collaborator

Description

This pull requests adds tracking of litter phosphorus concentrations. This follows an identical structure to the nitrogen case. I did consider trying to make a generic functions rather than duplicating functions, but it didn't feel worth the effort as we have no current plans to add further nutrients (e.g. Potassium).

As there weren't any structural changes I didn't split this up into separate PRs, hopefully it is a manageable size as a single PR.

Fixes #512

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

@jacobcook1995 jacobcook1995 linked an issue Aug 28, 2024 that may be closed by this pull request
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 28, 2024

Codecov Report

❌ Patch coverage is 93.33333% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.95%. Comparing base (ca04b51) to head (76f76f9).
⚠️ Report is 3338 commits behind head on develop.

Files with missing lines Patch % Lines
...ple_data/generation_scripts/litter_example_data.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #539      +/-   ##
===========================================
- Coverage    94.98%   94.95%   -0.03%     
===========================================
  Files           74       74              
  Lines         4145     4186      +41     
===========================================
+ Hits          3937     3975      +38     
- Misses         208      211       +3     

☔ 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

@dalonsoa dalonsoa left a comment

Choose a reason for hiding this comment

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

LGTM. IT follows a similar pattern than nitrogen and, to be honest, I've not spotted that many repetitions to be worrisome.

file = "../data/example_litter_data.nc"
var_name = "c_n_ratio_below_structural"
[[core.data.variable]]
file = "../data/example_litter_data.nc"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is just a generic question and nothing to do with this PR in particular. For what I can see, running a full Virtual Ecosystem simulation requires A LOT of data to be available. Is that data typically available or easy to find? Are you planning to provide defaults for them - some, at least? If the data can be downloaded from online repositories (for free), would you be including hooks to download that data in the background?

Copy link
Copy Markdown
Collaborator Author

@jacobcook1995 jacobcook1995 Aug 29, 2024

Choose a reason for hiding this comment

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

Yeah this is a good question. In general, a lot of this data will not be particularly easy to get, partly because ecological data tends to get reported in fairly inconsistent ways. But also because (at least in the soil and litter models) some variables are chosen because they make sense in the model context rather than being commonly measured empirically, e.g. structural litter isn't measured empirically, mass of dead leaves, twigs, branches etc is.

A few more (Malaysia based) postdocs have joined the team and their role will be getting the data needed for parameterisation, calibration and validation together. I'm not sure of the exact planned workflow there, but I believe the idea is to have all the scripts used to wrangle the data and the final datasets ready for input available online. So this probably make sense to be hooked in some way to the model itself, particularly for the non-site specific data.

@jacobcook1995 jacobcook1995 merged commit 1b9487d into develop Sep 10, 2024
@jacobcook1995 jacobcook1995 deleted the 512-litter-phosphorus branch September 10, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Litter phosphorus

3 participants