-
Notifications
You must be signed in to change notification settings - Fork 9
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
Annual fAPAR_max and LAI_max #403
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #403 +/- ##
===========================================
- Coverage 96.26% 93.57% -2.69%
===========================================
Files 34 36 +2
Lines 2652 2756 +104
===========================================
+ Hits 2553 2579 +26
- Misses 99 177 +78 ☔ View full report in Codecov by Sentry. |
@davidorme , could you have a look and sense-check what's there? As you suggested in #407 (I hope I understood that right) I used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some optimisations and a couple of issues. I think we're on the right track here. I did wonder about making the class __init__
accept daily/subdaily observations and moving the resampling in the from_Pmodel
into there, but on balance I think it is right to have the straightforward usage as __init__
and then use factory methods to handle other core inputs.
|
||
annual_total_potential_gpp = get_annual( | ||
pmodel.gpp, datetimes, growing_season, "total" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this need to check we are dealing with whole years in the input?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering whether this should be something similar as in __init__
of scaler, or something much more simple (like checking that growing_season
can be divided by 365 or 366).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah - this was tying me in knots as well. I think it needs to be something similar to the scaler init. We want to:
- Check that the timing is regular - although that is a pain when we want to support e.g. weekly or monthly inputs
- Check that there are the same number of observations per year - although that is a pain for leap years at daily precision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I implemented a check for the datetimes. I am sure I have missed something...
Probably a good time to implement tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It currently assumes daily or subdaily inputs
Co-authored-by: David Orme <[email protected]>
Co-authored-by: David Orme <[email protected]>
Co-authored-by: David Orme <[email protected]>
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More thoughts - not fully formed!
|
||
annual_total_potential_gpp = get_annual( | ||
pmodel.gpp, datetimes, growing_season, "total" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah - this was tying me in knots as well. I think it needs to be something similar to the scaler init. We want to:
- Check that the timing is regular - although that is a pain when we want to support e.g. weekly or monthly inputs
- Check that there are the same number of observations per year - although that is a pain for leap years at daily precision.
Co-authored-by: David Orme <[email protected]>
Description
Implements the computation of fAPAR_max and LAI_max, and provides examples usages of the API (including test data).
Fixes #348 .
Type of change
Key checklist
pre-commit
checks:$ pre-commit run -a
$ poetry run pytest
Further checks