Cell comparison: remove ancient netcdftime/cftime workarounds #4729
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚀 Pull Request
Description
Closes #4697. The example given there now produces
The first workaround was added at #1016. From the comments on the tests I removed, the comparisons were then falling back to comparing object ids, so presumably rich comparison was not implemented in that version of netcdftime at all. It is implemented now:
https://github.com/Unidata/cftime/blob/dc75368cd02bbcd1352dbecfef10404a58683f94/src/cftime/_cftime.pyx#L1314
The second workaround was added at #2440. The comment there says that
NotImplemented
was not always being returned by the comparison method. If I've understood correctly, @bjlittle put in a fix for this at Unidata/cftime#81 where, as far as I can tell, python2 was the main complication. @bjlittle's fix was merged in 2018 and we are now pinned to cftime >= 1.5 which is only a year old. So I think we should be safe.I'm currently targetting
main
, but I wonder if this should actually go in a patch release? #4697 suggests that this has now become a problem because time cell points have changed from beingdatetime.datetime
tocftime.datetime
. This was a breaking change in cf-units v3.0.Consult Iris pull request check list