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

Add StemAllometry class #306

Merged
merged 7 commits into from
Sep 30, 2024
Merged

Add StemAllometry class #306

merged 7 commits into from
Sep 30, 2024

Conversation

davidorme
Copy link
Collaborator

@davidorme davidorme commented Sep 29, 2024

Description

This PR introduces the demography.t_model_functions StemAllometry class. This bundles the allometric equations into a higher level wrapper that takes a Flora | StemTraits instance and a set of stem sizes as DBH.

This new class then replaces the existing Community._calculate_t_model method and all of the rest of the existing code is updated to access stem allometry data through the class attributes. It also adds a simple test to confirm that the bundled allometry calculations still agree with the expected values tested on the individual functions.

Fixes #305

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

@davidorme davidorme linked an issue Sep 29, 2024 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Sep 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.77%. Comparing base (1f315ba) to head (44498cf).
Report is 156 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #306      +/-   ##
===========================================
+ Coverage    95.29%   95.77%   +0.48%     
===========================================
  Files           28       34       +6     
  Lines         1720     2366     +646     
===========================================
+ Hits          1639     2266     +627     
- Misses          81      100      +19     
Flag Coverage Δ
95.77% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Collaborator

@MarionBWeinzierl MarionBWeinzierl 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 all sensible to me

@davidorme davidorme merged commit 44e3e65 into develop Sep 30, 2024
12 checks passed
@davidorme davidorme deleted the 305-add-stemallometry-class branch September 30, 2024 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add StemAllometry class
3 participants