Repository navigation
Fix bug in overlap_slices - #16544
Merged
Merged
Conversation
Contributor
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
larrybradley
force-pushed
the
fix-overlap-slices
branch
from
June 6, 2024 19:46
c2c1a7e to
bc86bd4
Compare
neutrinoceros
approved these changes
Jun 7, 2024
neutrinoceros
left a comment
Contributor
There was a problem hiding this comment.
I think the test case should live in test_slices_no_overlap. Otherwise LGTM
neutrinoceros
requested changes
Jun 7, 2024
neutrinoceros
left a comment
Contributor
There was a problem hiding this comment.
whoops, I didn't mean to approve just yet.
1 task
larrybradley
force-pushed
the
fix-overlap-slices
branch
from
June 7, 2024 15:18
bc86bd4 to
df00b1a
Compare
neutrinoceros
approved these changes
Jun 7, 2024
neutrinoceros
approved these changes
Jun 7, 2024
Member
Author
bmorris3
approved these changes
Jun 12, 2024
bmorris3
left a comment
Contributor
There was a problem hiding this comment.
Looks good, thanks @larrybradley!
Member
|
Thanks for the PR and reviews! |
meeseeksmachine
pushed a commit
to meeseeksmachine/astropy
that referenced
this pull request
Jun 12, 2024
jeffjennings
pushed a commit
to jeffjennings/astropy
that referenced
this pull request
Jun 14, 2024
pllim
added a commit
that referenced
this pull request
Jun 14, 2024
…544-on-v6.1.x Backport PR #16544 on branch v6.1.x (Fix bug in overlap_slices)
rlwastro
pushed a commit
to rlwastro/astropy
that referenced
this pull request
Jun 14, 2024
d-giles
referenced
this pull request
in d-giles/astropy-abdufork
Jul 26, 2024
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.
Description
This PR fixes an edge-case bug in
overlap_sliceswhere instead of raising aNoOverlapError, it would return an "empty" tuple slice:The input slices do NOT overlap. However, the function returns an "empty" slice tuple (
(slice(0, 0, None), slice(0, 0, None)) instead of raising aNoOverlapError.For some reason, this function allows the input
small_array_shapeto be(0, 0). In that case, a slice tuple of ((slice(0, 0, None), slice(0, 0, None)) is also returned. There is a test for that case, so I left that behavior unchanged. However, IMHO,small_array_shape = (0, 0)should also raiseNoOverlapError.