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

DM-43416: Fix warning in bbox_contains_sky_coords #732

Merged
merged 3 commits into from
Apr 30, 2024
Merged

Conversation

kfindeisen
Copy link
Member

This PR fixes a bug in coordinate checks that attempted to convert NaN or infinite values to integers. The bug was exposed by unit tests, but went unnoticed because it only caused a warning instead of an error.

Previously, bbox_contains_sky_coords would try to convert NaN or
infinite pixel values to integers, emitting a warning and risking
undefined behavior.

This commit does not address the question of _how_ fractional pixels
should be converted to integers, as that depends on the
counterintuitive behavior of Box.
Copy link
Contributor

@isullivan isullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My request might be out of scope for this ticket, but should be a simple change to make the code work the way the docstring describes. That should solve the problem of nan values, as well.

This commit reduces the number of calculations in the case that many
points like far outside the bounding box.
@kfindeisen kfindeisen merged commit 9c22b29 into main Apr 30, 2024
2 checks passed
@kfindeisen kfindeisen deleted the tickets/DM-43416 branch April 30, 2024 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants