-
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.27% 94.75% -1.53%
===========================================
Files 34 38 +4
Lines 2659 2860 +201
===========================================
+ Hits 2560 2710 +150
- Misses 99 150 +51 ☔ 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
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.
… - lots of code duplication still
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
Co-authored-by: David Orme <[email protected]>
1f2087a
to
f51db91
Compare
I have marked this as ready for review now, although there is still no integration test - I am trying to figure out whether there is something easier than the whole LAI example. What do you think about merging in what is there and create a separate issue for the regression test @davidorme ? |
I created issue #436 to implement regression 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.
@MarionBWeinzierl Some minor doc stuff and simple syntax changes. Then I think this is great as something to build regression tests and further development around.
Co-authored-by: David Orme <[email protected]>
…llegeLondon/pyrealm into issue348_annual_fapar_and_lai
@MarionBWeinzierl I'm just wondering about what we want to do about We don't want too many branches hanging around but it feels like it is worth keeping this partial implementation out of the |
Hm, I am not exactly enthusiastic about the idea, as it will mean more effort to make sure it does not diverge even more from the main implementation. We have merged in other not-quite-complete implementations, building things up incrementally. How is this part different? |
I agree it is a change in how we've handled feature branches. I want to get all of the stuff in #383 down into I guess I've also treated new features very much as a firehose of things that are immediately public, which is one reason we've ended up with a big refactor for |
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