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

Using pyrealm within the Plants model #707

Merged
merged 61 commits into from
Feb 14, 2025
Merged

Conversation

davidorme
Copy link
Collaborator

@davidorme davidorme commented Jan 30, 2025

Description

This PR is to replace the placeholder internals of the Plants Model with actual pyrealm functionality. That is basically impossible to do in small steps, so this is an uncomfortably sprawling PR.

  • Replaces old plants config with new setup for T model parameters
  • Replaces flora structure with pyrealm Flora
  • Replaces cohort structure with pyrealm Cohorts
  • Replaces community structure with pyrealm Community
  • Uses pyrealm demography functionality to go from cohort DBH data to allometry
  • Uses PModel to estimate GPP and transpiration.

Tip

@vgro If you can look at the internals of the Plants Model setup and update to see if anything seems wrong
@sallymatson Could you look at the canopy, community and functional types to see if the way I'm using pyrealm structures is well enough described (for now, anyway).

Fixes #659
Fixes #655

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 Jan 30, 2025 that may be closed by this pull request
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.

Thanks for making the changes - LGTM!

@vgro vgro self-requested a review February 11, 2025 15:25
Copy link
Collaborator

@vgro vgro left a comment

Choose a reason for hiding this comment

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

Looks good to me, a few points that we might want to discuss in person. One change that is unclear at the moment is what happened to the Cohorts?

@davidorme
Copy link
Collaborator Author

davidorme commented Feb 12, 2025

@vgro Thanks for those comments - I've resolved the simple typos and doc updates and commented on the others. Could you review my responses and either resolve them if you are happy or flag them for more discussion!

I've updated the docs to give more clarity on cohorts - they are part of the pyrealm community objects.

Copy link
Collaborator

@vgro vgro left a comment

Choose a reason for hiding this comment

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

This looks good to me. The only remaining issue I have is the name of the canopy_absorption which I think we should change if we include the radiation absorbed by the soil.

@davidorme davidorme merged commit 3c11535 into develop Feb 14, 2025
16 checks passed
@davidorme davidorme deleted the 659-use-pyrealm-flora branch February 14, 2025 11: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.

Update plants model to use pyrealm flora definition Switch plant model community handling to use pyrealm
4 participants