Skip to content
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

fix intersection out of bounds point #4046

Closed
wants to merge 1 commit into from

Conversation

rcomer
Copy link
Member

@rcomer rcomer commented Mar 2, 2021

🚀 Pull Request

Description

Fixes #3391 I think. This addresses the very specific case where you request the entire 360 degrees, and one of the bounds is at the maximum/minimum threshold. Taking @valeriupredoi's example from #3391, you would still get that negative longitude point if you did something like cube.intersection(longitude=(0, 50)). I'm not sure that that makes sense but, looking at the tests, it appears to have been intentional.

I haven't added any extra comment to explain my logic, but I think it's covered by the existing:

iris/lib/iris/cube.py

Lines 3178 to 3180 in a9ae72f

# being split. For bounds which may extend exactly the length of
# the modulus, we simply preserve the point to bound difference,
# and call the new bounds = the new points + the difference.


Consult Iris pull request check list

@rcomer rcomer force-pushed the intersection-bounds-fix branch 2 times, most recently from 1b32956 to 3b0aa0e Compare March 2, 2021 20:24
@bjlittle
Copy link
Member

@rcomer Hmmm you may have to re-open a new commit based on v3.0.x and cherry-pick out your commits onto it... or whatever is easiest.

As it stands, this PR is pulling unwanted master commits onto the v3.0.x release feature branch. Soz.

@rcomer
Copy link
Member Author

rcomer commented Mar 10, 2021

😱

@rcomer rcomer changed the base branch from v3.0.x to master March 10, 2021 15:09
@rcomer
Copy link
Member Author

rcomer commented Mar 10, 2021

@bjlittle see #4059

@rcomer rcomer closed this Mar 10, 2021
@rcomer rcomer deleted the intersection-bounds-fix branch May 13, 2021 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cube.intersection out of bounds point
2 participants