-
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
Development fx restructured #21
Conversation
Can you please merge the |
le done 🍺 |
files = find_files(input_dirs, filenames_glob) | ||
|
||
return files | ||
|
||
|
||
def get_input_filelist(variable, rootpath, drs): | ||
"""Return the full path to input files.""" | ||
# change ensemble to fixed r0i0p0 for fx variables | ||
if variable['project'] == 'CMIP5'and variable['frequency'] == 'fx': | ||
variable['ensemble'] = 'r0i0p0' |
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.
You're already setting the ensemble in _recipe.py, so I think there is no need to do it again here
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.
ermm, I don't think that gets picked up for all the cases, lemme test
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.
Have you had a chance to do this yet?
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.
not yet 😢
I think we should also get rid of the funky syntax for specifying fx variables. So instead of this (example from recipe_ocean_Landschuetzer2016.yml): diagnostics:
diag_timeseries_surface_average_vs_OBS:
variables:
dpco2:
mip: Omon
fx_files: [areacello, ]
spco2:
mip: Omon
fx_files: [areacello, ]
fgco2:
mip: Omon
fx_files: [areacello, ] we should have diagnostics:
diag_timeseries_surface_average_vs_OBS:
variables:
dpco2:
mip: Omon
spco2:
mip: Omon
fgco2:
mip: Omon
areacello:
mip: Omon If we do it like this, it has the advantage that fixes and cmor checks are applied automatically to fx variables in the same way as they are applied to normal variables. The only remaining issue is then how to apply fixes to fx variables that are used as input to preprocessor functions, but that is something we can solve later. Does this make sense? |
yes, I like that and I initially wanted to do it this way but the problem is that the preprocessor masking with fx is way more frequent in a lot of recipes than just using the fx files/variables in the diagnostics only so we need that functionality more stringently - I think we should probably leave it as is now for now, since this way (this PR) mirrors the previous functionality (with the added funky syntax yes) and set this up for a change for v2.1. What say you @mattiarighi @bouweandela @ledm |
#22 is actually doing more so might wanna look at this instead |
Hi V., I though that the simplification of the variable definition as described in in #21 (comment) was the whole point of this pull request. If not, what problem is this actually solving? Is there an associated issue? |
@bouweandela (sorry man, I was travelling yesterday, am fully back in work now) - this PR does a few things:
Note that to have the usage of fx variables and files in the preprocessor via Alas, there is no issue for this PR but there is one for both this PR and #22 in #46 |
files = find_files(input_dirs, filenames_glob) | ||
|
||
return files | ||
|
||
|
||
def get_input_filelist(variable, rootpath, drs): | ||
"""Return the full path to input files.""" | ||
# change ensemble to fixed r0i0p0 for fx variables | ||
if variable['project'] == 'CMIP5'and variable['frequency'] == 'fx': |
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.
if variable['project'] == 'CMIP5'and variable['frequency'] == 'fx': | |
if variable['project'] == 'CMIP5' and variable['frequency'] == 'fx': |
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.
whoops
@@ -361,6 +362,45 @@ def _get_default_settings(variable, config_user, derive=False): | |||
return settings | |||
|
|||
|
|||
def get_input_fx_filelist(variable, rootpath, drs): |
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 function should be removed altogether, it looks like it migrated here from _data_finder.py
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.
reply below in the main body of the issue
I would prefer to have this done in this pull request. Because now it looks like a cleanup operation that is only half done, you remove the |
the problem is that we are still keeping the |
Which preprocessor function requires a dictionary with fx files? The ones in esmvalcore/preprocessor/_mask.py only require a list of files, which can simply be returned by |
That's another discussion. I've written an answer in the issue. |
|
yes, I saw it and makes sense but that's not gonna be easy-peasy. Would you rather soend time on that or allow a kludge like this one here. For a nice functional way we should get the independent fx variables as regular variables implementation but note that now, as things stand in the trunk, CMIP6 fx variables dont work at all so we need something in the meantime. I am buried under documentation at the moment and I can restart this only next week. Also, have you seen #22 - that fixes all the problems bar removing the fx_files dict, which can probably be done quickly |
If you could do that in this pull request would be great.
I believe that pull request includes the changes in this pull request plus extra stuff, right? If so, I think this pull request should be finished before we start on the other one. |
🐫 🍺
|
superseded for now by #170 |
Related issue #109
porting ESMValGroup/ESMValTool#1065 to ESMValCore/version2_development