Cell comparison: remove ancient netcdftime/cftime workarounds#4729
Merged
trexfeathers merged 2 commits intoSciTools:mainfrom Oct 7, 2022
Merged
Cell comparison: remove ancient netcdftime/cftime workarounds#4729trexfeathers merged 2 commits intoSciTools:mainfrom
trexfeathers merged 2 commits intoSciTools:mainfrom
Conversation
rcomer
commented
May 5, 2022
Contributor
|
@pdearnshaw we're not planning a bugfix release for this, so it would instead be released as part of Iris |
trexfeathers
requested changes
Oct 7, 2022
Contributor
trexfeathers
left a comment
There was a problem hiding this comment.
@rcomer What's New and I'll merge 👍
8bf85e9 to
8c01a52
Compare
trexfeathers
approved these changes
Oct 7, 2022
Member
Author
|
Thanks @trexfeathers! |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
NotImplementedwas 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.datetimetocftime.datetime. This was a breaking change in cf-units v3.0.Consult Iris pull request check list