-
Notifications
You must be signed in to change notification settings - Fork 283
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
Allow extraction with bounded time-coordinates. #5175
Labels
Good First Issue
A good issue to take on if you're just getting started with Iris development
Comments
trexfeathers
added
the
Good First Issue
A good issue to take on if you're just getting started with Iris development
label
Mar 1, 2023
See #5396 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Good First Issue
A good issue to take on if you're just getting started with Iris development
A user enquiry revealed that at least some extractions from bounded time coordinates are "banned".
There is a specific test+fail in place for these cases.
We think that this restriction can now be removed, as the various time objects all now provide reliable comparison operations. (see below)
This was revealed when trying to extract a timepoint matching one from another cube, like this ...
The key problem is here in iris.coords.Cell.contains_point()
It seems this "blanket ban" was introduced by #1016 in response to #984
In catching any use of a datetime-like object, as something posessing a 'timetuple' property, it also includes PartialDateTime which also provide that property (for some compatibility reasons, not made entirely clear!).
@rcomer suggests that, when this was added, it was a key problem that 'netcdftime.datetime' objects provided a seriously "broken" comparison operation.
We think that this test+fail can now be removed, as the other time objects now provide reliable comparison operations.
The objects we now have to deal with in this code are datetime.datetime, cftime.datetime (and it's deprecated subclasses..), and a PartialDateTime.
notable:
PDT(year=2000, month=3) <= X < PDT(year=2011, month=6)
The text was updated successfully, but these errors were encountered: