-
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
Check presence of time bounds and guess them if needed #849
Conversation
Hi @sloosvel let's see if we can get this merged. I can do a round of review (already had a quick look, seems good). But before I continue with testing etc., can you
In general, I think your approach at guessing the bounds looks very decent. Actually, another place in the code where we guess time bounds is in the regrid time preprocessor: ESMValCore/esmvalcore/preprocessor/_time.py Line 721 in 694f993
I'd say your approach here looks better, and I wonder if we could/should somehow make them consistent and at the same time avoid code duplication. Any thoughts on that? |
I guess some lines could be moved as functions to either _time.py or _shared.py? |
I don't think I can fix the remaining Codacy issues. |
Great, now the tests pass :-)
Yes, a |
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.
Hey @sloosvel,
This PR does what it says, so in principle I'm already convinced we should merge it. I just have a few remaining questions that I'm hoping you could help me with, especially regarding the tests.
Co-authored-by: Peter Kalverla <peter.kalverla@gmx.com>
Is there anything left to address here? I added new tests as requested. |
I'll try to have another look today or otherwise early next week. Last time I checked I wasn't sure if you were still working on it. |
No problem! I kind of put it aside because of things I had pending for the release. |
Looks good! All tests pass locally. I just merged master to verify that they also pass on CI with the most recent changes. |
Okay just one more thing: could you have another look at the codacy issue? I don't see the circular imports if I try to move it to the top. All greens would help to get it merged :-) |
Thanks @sloosvel happy to see this merged :-) |
A check for the presence of time bounds has been added. If they are required but they are not present, they are guessed with the following criteria:
hourly, 3hourly, 6hourly and daily data: the bounds are set considering the corresponding delta time.
Monthly data: the minimum bound is set at the first day of the month at 00h. The maximum bound is set at the first day of the next month at 00h.
Yearly data: the minimum bound is set at the first day of the year at 00h. The maximum bound is set at the first day of the next year at 00h.
Decadal data: the minimum bound is set at the first day of the year at 00h. The maximum bound is set at the first day of the next ten years at 00h.
Before you start, please read our contribution guidelines.
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 #802 , closes #803