Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding inorganic phosphorus pools to the soil model #672

Merged
merged 17 commits into from
Jan 15, 2025

Conversation

jacobcook1995
Copy link
Collaborator

Description

This pull request adds three inorganic phosphorus pools to the soil model. One of these forms of phosphorus (labile phosphorus) can be used by microbes so this pull requests alters that part of the model, as now there are two sources of phosphorus that microbes can grow from. The other two pools don't do all that much and basically just exist as stores of inorganic phosphorus in the soil, as such transfers involving these pools are just governed by slow linear kinetics.

Based on @dalonsoa comments on my last PR I've tried to replace returned dictionaries with dataclasses to make the code clearer.

Obviously this is a pretty science heavy PR but feedback on code style etc would be useful. I need to make further tweaks to this section of code in the immediate future, so feel free to suggest longer term improvements if they occur.

Fixes #663

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 Jan 13, 2025 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Jan 13, 2025

Codecov Report

Attention: Patch coverage is 97.85714% with 3 lines in your changes missing coverage. Please review.

Project coverage is 94.63%. Comparing base (017c70f) to head (4dc09cb).

Files with missing lines Patch % Lines
...ample_data/generation_scripts/soil_example_data.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #672      +/-   ##
===========================================
+ Coverage    94.56%   94.63%   +0.07%     
===========================================
  Files           73       73              
  Lines         4634     4757     +123     
===========================================
+ Hits          4382     4502     +120     
- Misses         252      255       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@sallymatson sallymatson left a comment

Choose a reason for hiding this comment

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

It all looks good to me, and the changes to dataclasses make it clearer. To be honest I don't know the code architecture well enough yet to feel confident in giving approval just bc I can't really think through the implications, so I'll let the other's do that :)

@dalonsoa
Copy link
Collaborator

I'm at a conference this week and cannot review this in detail. If you can wait until next week, great! Otherwise, just move on if there're enough positive reviews.

Copy link
Collaborator

@alexdewar alexdewar left a comment

Choose a reason for hiding this comment

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

I can't comment on the science, but the code changes seem reasonable and clear.

@jacobcook1995 jacobcook1995 merged commit 3871fb3 into develop Jan 15, 2025
13 checks passed
@jacobcook1995 jacobcook1995 deleted the 663-add-inorganic-phosphorus-pools branch January 15, 2025 08:58
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.

add inorganic phosphorus pools
5 participants