ImperialCollegeLondon / pyrealm

Development of the pyrealm package, providing an integrated toolbox for modelling plant productivity, growth and demography using Python.
https://pyrealm.readthedocs.io/
MIT License
19 stars 8 forks source link

Allow P Models to accept an array of kphio values #263

Closed davidorme closed 1 month ago

davidorme commented 2 months ago

Description

This PR update the kphio arguments to PModel and SubdailyPModel to accept an array of kphio estimates. This is largely intended to allow users to test alternative models for calculating kphio - there is an approach that accounts for temperature and soil moisture being developed.

The PR then includes a new test suite for this feature that checks that outcomes of passing in an array of kphio values is identical to the predictions of calculating those values using a single value at a time, and that the results are not sensitive to the shape of the inputs. That is repeated for PModel and SubdailyPModel.

Fixes #261

Type of change

Key checklist

Further checks

codecov-commenter commented 2 months ago

Codecov Report

Attention: Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 95.29%. Comparing base (84a43cc) to head (2decab8). Report is 8 commits behind head on develop.

Files Patch % Lines
pyrealm/pmodel/pmodel.py 88.88% 1 Missing :warning:
pyrealm/pmodel/subdaily.py 93.75% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #263 +/- ## ======================================== Coverage 95.29% 95.29% ======================================== Files 28 28 Lines 1720 1720 ======================================== Hits 1639 1639 Misses 81 81 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

davidorme commented 1 month ago

Do we need to add a bit more documentation to guide users on how they can use this new feature? Or is it in line with what we currently have?

Great point - I've added a short paragraph to the user facing PModel docs.