Skip to content

Recruitment of new tree cohorts#827

Merged
davidorme merged 41 commits intodevelopfrom
824-recruitment-of-new-tree-cohorts
Sep 8, 2025
Merged

Recruitment of new tree cohorts#827
davidorme merged 41 commits intodevelopfrom
824-recruitment-of-new-tree-cohorts

Conversation

@davidorme
Copy link
Copy Markdown
Collaborator

@davidorme davidorme commented Apr 11, 2025

Description

Since #812, we have had allocation of carbon to reproductive propagules in the plant model and numbers of propagules in the model.

This PR is to provide an initial draft of recruitment of new cohorts from those propagules:

  • Adds a germination rate to convert propagules into new tree cohorts. This is currently global but should be per PFT at some point, like the mortality rate.
  • Implements an apply_recruitment method that uses the germination rate to convert propagules into seedlings and adds those seedlings as new cohorts to the Community object in the cell.
  • Add initial values for the PFT propagule pool to the required data in the model.
  • Updates testing to pass with recruitment and mortality.

Things to worry about later - probably convert each of these to its own issue

  • The initial stem diameter is entirely arbitrary - we need to find some kind of initial DBH and stochiometry from the carbon and nutrients available in the propagule. We could set that as a trait, but it would be better to work it out from first principles using the T Model.

    [Converted to issue Plant initial stem diameter is arbitrary #1024]

  • The separation of the subcanopy vegetation and the seedlings. The light environment of these two different groups matters a lot to seedling success. If we go with an infinitely thin algal mat model for the subcanopy vegetation, then all seedlings are instantly above the subcanopy. That's easy to code but wildly inaccurate.

    [This is what we are doing for now - @arne-exe and @davidorme have started discussing a shrub layer which would make this complex, but that's way down the line]

  • Check to see if empty cohorts are removed following mortality of all individuals. I don't think they are at present.

  • I'm still seeing bizarre errors in growth patterns. Something is up with the GPP units, I think.

Fixes #824

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

@davidorme davidorme linked an issue Apr 11, 2025 that may be closed by this pull request
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jul 4, 2025

Codecov Report

❌ Patch coverage is 98.14815% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.21%. Comparing base (14fff18) to head (c1d7217).
⚠️ Report is 359 commits behind head on develop.

Files with missing lines Patch % Lines
...mple_data/generation_scripts/plant_example_data.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #827      +/-   ##
===========================================
+ Coverage    95.13%   95.21%   +0.07%     
===========================================
  Files           80       80              
  Lines         6722     6770      +48     
===========================================
+ Hits          6395     6446      +51     
+ Misses         327      324       -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.

@davidorme davidorme marked this pull request as ready for review July 4, 2025 12:18
@davidorme davidorme requested a review from sallymatson July 4, 2025 16:03
@sallymatson sallymatson mentioned this pull request Jul 25, 2025
5 tasks
@davidorme
Copy link
Copy Markdown
Collaborator Author

@sallymatson This is a bit of a monster now (although there have been worse!). I've reviewed all of the stochiometry stuff though, and tests pass. Could you review?

@davidorme
Copy link
Copy Markdown
Collaborator Author

The initial stem diameter is entirely arbitrary - we need to find some kind of initial DBH and stochiometry from the carbon and nutrients available in the propagule. We could set that as a trait, but it would be better to work it out from first principles using the T Model.

Copy link
Copy Markdown
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.

LGTM. I had reviewed before I started the stoichiometry stuff and it all made sense to me then, and when I added as well.

@davidorme davidorme enabled auto-merge September 8, 2025 15:27
@davidorme davidorme merged commit 502b88d into develop Sep 8, 2025
13 checks passed
@davidorme davidorme deleted the 824-recruitment-of-new-tree-cohorts branch January 9, 2026 14:27
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.

Recruitment of new tree cohorts

3 participants