-
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
Moved extraction of reference datasets for (horizontal and vertical) regridding into preprocessor functions #1455
Conversation
@valeriupredoi @zklaus Before I adapt the tests here, can I briefly get your feedback on this implementation? Does it make sense in your opinion? |
thanks a bunch @schlunma - looking at it now, sorry it escaped my wits yesterday! |
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.
draft request changes to a draft PR, not gonna be anal before it's actually RfR 😁
---- | ||
If ``levels`` is a ``dict`` and it does not contain the key ``filename``, | ||
it is automatically assumed that you specified the target grid with | ||
``start_longitude``, ``end_longitude``, etc. If a valid reference dataset |
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.
wait what? A grid is specified by an MxN specification, not by defining a box, am confusado 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.
ah nevermind, it's the _spec_to_latlonvals()
stuff - can you add a pointer to that func here maybe, that confused me, prob gonna confuse somebody else too
so here's the thing - as I understand it, your are now passing all the basic ingredients to the regrid preprocessor, rather than have some bits done first in recipe and then others (like the reference level extraction) be done via the regridder preprocessor - I like it! I like that stuff gets done by the module that needs to do it, and not outside it. What happens if there's an issue with the reference dataset, other than a CMOR issue, that might not even be picked up if the user chooses to run with all CMOR shields down? Will that surface only when the regridder is called? That might be after a lot of stuff has already been computed |
Co-authored-by: Valeriu Predoi <[email protected]>
It will surface once the reference dataset has entered the preprocessor chain, so probably a little bit earlier than the actual regridding. I agree that this is not ideal because it also increases the computation times by duplicating the loading for every dataset, but I don't see another way right now. Something that might be possible is to add an additional step between the check for data availability (and the downloading) and the actual start of the preprocessing, but this is something I can't do for v2.5. I'm not sure how to proceed. Should I try to get this in or leave it to v2.6 and come up with a cleaner solution? |
thanks for the note, Manu! The question is what's the immediate benefit of this vs the cost it introduces and vs a longer mulling over and possible implementation of a download me/check me/use me function for datasets before the preprocessor starts? I'd also want to hear what @zklaus and @bouweandela think about this 🍺 |
The short-term benefit is that the bug mentioned in #1454 is fixed. But after giving this some more thoughts I think this should be implemented properly, e.g., by adding a function ESMValCore/esmvalcore/_recipe.py Lines 1752 to 1763 in 3a3e5f5
Maybe I can address this for v2.5, but if not we can do a bugfix or even postpone this to v2.6, I don't think it's that urgent. |
thanks, Manu! I am of the personal opinion that this should not be hurried up, but rather done in a take it easy, test proper manner - up to you and the others, am not gonna block progress 🇨🇳 😁 |
I cannot finish this PR in time for v2.6, moving this to v2.7. |
This would also be addressed (differently) in #1609. |
Description
This PR moves the extraction of reference datasets used for horizontal and vertical regridding to the dedicated preprocessor functions. This allows us to specify reference datasets that need to be (automatically) downloaded first.
In addition, it adds fixes prior to the loading step of the reference dataset for horizontal regridding, similar to what is already done for the target levels for vertical regridding.
Closes #1454
Closes #56
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: