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 a litter model #268

Merged
merged 32 commits into from
Aug 2, 2023
Merged

Adding a litter model #268

merged 32 commits into from
Aug 2, 2023

Conversation

jacobcook1995
Copy link
Collaborator

Description

This pull request adds a litter model to the Virtual Rainforest. The purpose of this model is to handle the decomposition of complex biomass lying on or just under the forest floor.

I made this a separate model from the soil model for a couple of reasons:

  1. There are plausible use cases (mainly animal focused) where you would want to track the litter (as a resource for consumption) but not the full soil nutrient cycles.
  2. There's an alternative microbially explicit approach to modelling litter decay that I would like to try (if I get the time). I feel like this would be easier to implement with the litter model separated from the soil model.

At the moment, the model only has two pools "above_ground_metabolic" and "above_ground_structural" which represent the fast and slow decomposing above ground litter, respectively. In future, below ground pools and wood pools will also be added. The model will also get quite a lot more complex when we add leaf chemistry in (lignin, N and P).

I originally planned to add links from this model to the soil model in, but I thought that pull request was already getting large enough, so decided to save that for a later pull request.

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

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've got some minor queries/suggestions, but otherwise LGTM!

tests/conftest.py Show resolved Hide resolved
virtual_rainforest/models/litter/litter_model.py Outdated Show resolved Hide resolved
virtual_rainforest/models/litter/litter_model.py Outdated Show resolved Hide resolved
virtual_rainforest/models/litter/litter_model.py Outdated Show resolved Hide resolved
virtual_rainforest/models/soil/carbon.py Show resolved Hide resolved
Copy link
Collaborator

@davidorme davidorme left a comment

Choose a reason for hiding this comment

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

Not a lot to add to @alexdewar. LGTM

@codecov-commenter
Copy link

codecov-commenter commented Aug 2, 2023

Codecov Report

Merging #268 (81c18f8) into develop (6e4c413) will increase coverage by 0.26%.
Report is 11 commits behind head on develop.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop     #268      +/-   ##
===========================================
+ Coverage    95.27%   95.54%   +0.26%     
===========================================
  Files           43       47       +4     
  Lines         1778     1885     +107     
===========================================
+ Hits          1694     1801     +107     
  Misses          84       84              
Files Changed Coverage Δ
virtual_rainforest/models/soil/carbon.py 100.00% <ø> (ø)
virtual_rainforest/models/soil/soil_model.py 100.00% <ø> (ø)
virtual_rainforest/models/hydrology/constants.py 100.00% <100.00%> (ø)
...ual_rainforest/models/hydrology/hydrology_model.py 100.00% <100.00%> (ø)
virtual_rainforest/models/litter/__init__.py 100.00% <100.00%> (ø)
virtual_rainforest/models/litter/constants.py 100.00% <100.00%> (ø)
virtual_rainforest/models/litter/litter_model.py 100.00% <100.00%> (ø)
virtual_rainforest/models/litter/litter_pools.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@TaranRallings TaranRallings left a comment

Choose a reason for hiding this comment

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

LGTM!

@jacobcook1995 jacobcook1995 merged commit 7fa0d30 into develop Aug 2, 2023
@jacobcook1995 jacobcook1995 deleted the feature/litter_model branch August 2, 2023 14:20
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.

5 participants