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

Add unit tests that use gwcs. Fix how the bounding box is handled. #167

Merged
merged 3 commits into from
Jan 8, 2025

Conversation

mcara
Copy link
Member

@mcara mcara commented Jan 7, 2025

Adds unit tests that utilize gwcs in addition to FITS WCS.

@mcara mcara added the testing label Jan 7, 2025
@mcara mcara requested a review from nden January 7, 2025 18:37
@mcara mcara self-assigned this Jan 7, 2025
@mcara mcara requested a review from a team as a code owner January 7, 2025 18:37
@mcara mcara added the bug label Jan 7, 2025
@mcara mcara changed the title Add unit tests that use gwcs Add unit tests that use gwcs. Fix how the bounding box is handled. Jan 7, 2025
drizzle/utils.py Outdated
@@ -61,6 +61,8 @@ def calc_pixmap(wcs_from, wcs_to, shape=None):
shape = wcs_from.array_shape
if shape is None:
if (bbox := getattr(wcs_from, "bounding_box", None)) is not None:
if not isinstance(bbox, tuple):
bbox = bbox.bounding_box()
Copy link
Contributor

Choose a reason for hiding this comment

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

This will work only if bounding_box is an instance of modeling.bounding_box.ModelBoundingBox, so a better check is that it is that instance.

Copy link
Contributor

@nden nden left a comment

Choose a reason for hiding this comment

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

Looks good, other than the one comment

@mcara mcara requested a review from WilliamJamieson January 7, 2025 21:18
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.32%. Comparing base (a6fd81a) to head (03301c2).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #167      +/-   ##
==========================================
+ Coverage   97.27%   97.32%   +0.04%     
==========================================
  Files           3        3              
  Lines         220      224       +4     
==========================================
+ Hits          214      218       +4     
  Misses          6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mcara mcara merged commit dab1009 into spacetelescope:main Jan 8, 2025
21 checks passed
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.

2 participants