-
Notifications
You must be signed in to change notification settings - Fork 39
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
Apply clip_timerange
to time dependent fx variables
#1603
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1603 +/- ##
=======================================
Coverage 91.38% 91.39%
=======================================
Files 204 204
Lines 11173 11176 +3
=======================================
+ Hits 10211 10214 +3
Misses 962 962
Continue to review full report at Codecov.
|
We really have an unhealthy confusion in terminology. Outside of ESMValTool, fx stands for fixed in time. It makes no sense to talk of time-dependent fx files or variables. In ESMValTool we are conflating a few things, three, I think. Those are time-independent things associated with fx, cell measures that give information about grid cells, and ancillary variables that give extra information related to other variables, for example, a quality flag or a threshold. We should disambiguate our catch-all use of "fx" to better reflect what we are actually talking about. That will make fixes clearer and in the future help us to avoid this kind of situation. I know that this is a long-standing issue that has not originated with this PR, but I am a bit concerned that rather than making progress in the right direction, we are further entrenching the issue with more and more code that eventually should be changed. Would it be possible to try to reflect better terminology in some of the variable and function names? |
Would calling cell measures and ancillary vars In any case, even if the code in the core is updated, the recipes would still to have to call them |
Hm. I am not sure it's a good idea to mix those categories. Anyways, as far as I can see in this PR, we are really only dealing with cell measures, no? Perhaps then it is enough to refer to that, particularly in the test code. |
I think it's convenient to have a general name to refer both ancillary variables and measure, because the steps of adding, checking and removing them from the cube are the same. In any case, even if the code changes, they are still going to be referred as |
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 left a few comments to illustrate what I had in mind, i.e. not to change all the code that you basically didn't touch here, but rather to slightly nudge things in the right direction by using proper terminology in new tests etc.
Tangentially worth noting #1082 (comment) and the associated branch main...split-recipe
tests/integration/preprocessor/_ancillary_vars/test_add_fx_variables.py
Outdated
Show resolved
Hide resolved
tests/integration/preprocessor/_ancillary_vars/test_add_fx_variables.py
Outdated
Show resolved
Hide resolved
I guess this can be closed then? |
I'm not sure. @bouweandela, what do you think? |
I'll try to get #1609 done before the deadline, but it's a pretty big reshuffle of the recipe parsing code (I'm trying to uncook the pot of spaghetti that _recipe.py has become and put all the strands straight and back in the package). So I'm not sure if I'll make it in time and it also depends on if we think it's a good idea to include a pretty big reshuffle of the recipe parsing code just before the feature freeze.. but well, there is a month full of testing after the feature freeze of course. So it depends a bit on how keen you are on getting this into v2.6. |
Alright, then I suggest we forget all my comments, just get this in now as a stop-gap measure and hope that your reshuffle improves the overall situation either for 2.6.0 or shortly thereafter. |
It looks like I won't be able to get #1609 done in time, so please go ahead and include this in v2.6 if you need it in that release. |
Co-authored-by: Klaus Zimmermann <[email protected]>
No worries! It would be good to test this though, as I tend to overlook use cases. |
I will have a look on this on Friday or early next week. |
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!
Successfully tested this with the following recipe (took forever to run though, I'm really looking forward to #1545):
documentation:
description: Test
title: Test
authors:
- schlund_manuel
preprocessors:
area_stat:
area_statistics:
operator: mean
fx_variables:
areacella:
vol_stat:
volume_statistics:
operator: mean
fx_variables:
volcello:
mip: Omon
diagnostics:
test:
variables:
tas:
preprocessor: area_stat
mip: Amon
exp: historical
start_year: 2000
end_year: 2014
thetao:
preprocessor: vol_stat
mip: Omon
exp: historical
timerange: '200001/200001'
additional_datasets:
- {dataset: ACCESS-ESM1-5, project: CMIP6, ensemble: r1i1p1f1, grid: gn}
scripts:
null
In the current main
, this recipe fails. Thanks @sloosvel!!
Description
This PR makes sure to clip the timerange in time dependent fx variables
Closes #1602
Link to documentation:
Before you get started
Checklist
It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.
To help with the number pull requests: