Skip to content

Added production of fungal fruiting bodies #948

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

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

jacobcook1995
Copy link
Collaborator

Description

This PR adds production of fruiting bodies by soil fungi. On the soil side this change is fairly straightforward, fungi allocate a certain proportion of their new biomass to fruiting body production in the same way that they allocate to enzyme production. The production rate across all fungal groups is then summed and passed to the animal model.

The animal model stores the mass of fruiting bodies as a scavengable pool. As well as scavenging the animal model also updates this pool based on the input of new fruiting body biomass from the soil model, and the decay of fruiting bodies. This decay gets passed back to the soil model as low molecular weight carbon (and the equivalent forms of nitrogen and phosphorus). At each time step the animal model also updates the fungal fruiting body abundance in the data object.

@TaranRallings, I've added a reasonable amount of code to the animal model here, so let me know if you are happy with the changes.

Fixes #932. Fixes #907

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

codecov-commenter commented Jul 14, 2025

Codecov Report

Attention: Patch coverage is 96.33028% with 4 lines in your changes missing coverage. Please review.

Project coverage is 94.25%. Comparing base (de3daeb) to head (70f148a).
Report is 76 commits behind head on develop.

Files with missing lines Patch % Lines
virtual_ecosystem/models/animal/decay.py 91.42% 3 Missing ⚠️
...ample_data/generation_scripts/soil_example_data.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #948      +/-   ##
===========================================
+ Coverage    94.08%   94.25%   +0.16%     
===========================================
  Files           78       79       +1     
  Lines         6172     6404     +232     
===========================================
+ Hits          5807     6036     +229     
- Misses         365      368       +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
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.

It's a pretty long PR, but I think all makes sense and is clear. This is becoming more complicated by the minute...

@jacobcook1995
Copy link
Collaborator Author

This is becoming more complicated by the minute...

Yes this is the last addition that I intended to make to the soil model before moving onto bug-fixing and calibration, so this should be as most complex as the soil model gets 🤞

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.

The animal content looks good to me!

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.

Fungi should produce fruiting bodies calculate_new_biomass_average_nutrient_ratios calculates the weighted averages of the C:N:P ratios incorrectly
4 participants