Skip to content

Adding nitrogen mineralisation#616

Merged
jacobcook1995 merged 19 commits intodevelopfrom
605-soil-model-needs-to-track-organic-nitrogen
Nov 6, 2024
Merged

Adding nitrogen mineralisation#616
jacobcook1995 merged 19 commits intodevelopfrom
605-soil-model-needs-to-track-organic-nitrogen

Conversation

@jacobcook1995
Copy link
Copy Markdown
Collaborator

Description

This pull request adds two new pools to track nitrogen in the soil "soil_n_pool_don" and "soil_n_pool_particulate". These pools both receive input from litter mineralisation, and the DON (dissolved organic nitrogen) pool also leaches. Both pools are organic nitrogen pools, so effectively track the nitrogen stoichiometry of their corresponding carbon pools (the low molecular weight carbon (LMWC) pool and the particulate organic matter (POM) pool). The breakdown rate of POM to LMWC therefore determines the rate at which nitrogen goes from the particulate to the dissolved pool.

I've also tried to restructure the code a bit. I've added a new SoilPools class, which has method to calculate updates for all soil pools. I still feel like the contents of this method is a bit messy, but I couldn't see an obvious way to group the function steps that would make it clearer. I'm leaving this as is for now, but intended to refactor as further pools are added

Fixes #605

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 Oct 28, 2024 that may be closed by this pull request
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 28, 2024

Codecov Report

❌ Patch coverage is 96.07843% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.16%. Comparing base (a7efd83) to head (06e6b61).
⚠️ Report is 3101 commits behind head on develop.

Files with missing lines Patch % Lines
...ample_data/generation_scripts/soil_example_data.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #616      +/-   ##
===========================================
- Coverage    95.18%   95.16%   -0.02%     
===========================================
  Files           74       74              
  Lines         4380     4409      +29     
===========================================
+ Hits          4169     4196      +27     
- Misses         211      213       +2     

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

I've made a couple of comments/suggestions, but it looks good, otherwise.

@jacobcook1995
Copy link
Copy Markdown
Collaborator Author

jacobcook1995 commented Nov 5, 2024

@dalonsoa, I've tried to address all your suggestions. Let me know whether the changes look okay. Cheers!

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.

All looks good!

Co-authored-by: Diego Alonso Álvarez <6095790+dalonsoa@users.noreply.github.com>
@jacobcook1995 jacobcook1995 merged commit 79d9635 into develop Nov 6, 2024
@jacobcook1995 jacobcook1995 deleted the 605-soil-model-needs-to-track-organic-nitrogen branch November 6, 2024 08:42
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.

Soil model needs to track organic nitrogen

4 participants