-
Notifications
You must be signed in to change notification settings - Fork 36
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
Added clip_start_end_year preprocessor #796
Conversation
It would be good to take #345 into account, at least for the naming of the new preprocessor function. |
Ready for review |
wait - am thoroughly confused - now we have |
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.
see me comment above 🍺
Hey V., sorry I somehow didn't post my answer on your question above (which I already typed 😬). So here is the thing: I really think that we should merge this soon, other people ran into this issue as well: #762 (comment) and ESMValGroup/ESMValTool#1864 (comment). |
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 got persuaded by @schlunma - looks like something more flexible and frontend-y than the internal backend function 👍
@bascrezee @lukasbrunner @Peter9192 This looks like something you need #796 (comment), would one of you be willing to try if it works for your use case? |
Anyone currently reviewing this? Otherwise I can have a go at it |
Yes, please have a go at it @Peter9192. Thanks! |
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.
Code looks good @schlunma ! I left a few comments, will now proceed with some offline testing.
One general question: is extract_timerange
really the most suitable name for this preprocessor, or can we come up with something slightly more distinguishing? clip_start_endyear
is the best I could come up with so far.
Pytest locally ran fine after merging origin/master into this branch, and I tested with a custom recipe, which also produced the expected results. So I'm quite happy with the code. If you could just address my comments/questions above, then I think we're good to go. test diagnosticdocumentation:
description: test PR
authors:
- kalverla_peter
preprocessors:
tas_anomalies:
custom_order: true
area_statistics:
operator: mean
anomalies:
period: full
reference:
start_year: 1981
start_month: 1
start_day: 1
end_year: 2010
end_month: 12
end_day: 31
standardize: false
extract_time:
start_year: 2081
start_month: 1
start_day: 1
end_day: 31
end_month: 12
end_year: 2099
diagnostics:
test1:
variables:
tas:
start_year: 1965
end_year: 2099
mip: Amon
preprocessor: tas_anomalies
additional_datasets:
- {dataset: ACCESS1-0, project: CMIP5, exp: [historical, rcp85], ensemble: r1i1p1}
scripts:
quickplot:
script: examples/diagnostic.py
quickplot:
plot_type: plot |
Co-authored-by: Peter Kalverla <peter.kalverla@gmx.com>
Co-authored-by: Peter Kalverla <peter.kalverla@gmx.com>
Co-authored-by: Peter Kalverla <peter.kalverla@gmx.com>
Thanks @Peter9192 for your review! 👍 I included all your comments, so this PR should be ready now. |
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.
Thanks @schlunma I think you missed one rename, but otherwise I'm happy to see this merged
Co-authored-by: Peter Kalverla <peter.kalverla@gmx.com>
This PR adds an
clip_start_end_year
preprocessor which is necessary to move theextract_time
,extract_month
andextract_season
preprocessors down in the preprocessor order which allows their use withcustom_order: true
.Tasks
yamllint
to check that your YAML files do not contain mistakesIf you need help with any of the tasks above, please do not hesitate to ask by commenting in the issue or pull request.
Closes #762