Skip to content

Add protections against duplicate frames#545

Merged
nden merged 15 commits intospacetelescope:masterfrom
WilliamJamieson:feature/pipeline
Jan 31, 2025
Merged

Add protections against duplicate frames#545
nden merged 15 commits intospacetelescope:masterfrom
WilliamJamieson:feature/pipeline

Conversation

@WilliamJamieson
Copy link
Collaborator

This PR refactors GWCS with the goal of fixing issue #178; namely, that adding two frames with the same name causes the gwcs to behave weirdly.

This is accomplished by pulling the "pipeline" management code into a separate object and then adding protections in that object to prevent two frames of the same name to be added. Moreover, it also makes sure the last transform in the pipeline is None as there is nothing for it to transform to.

@codecov
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 87.47664% with 67 lines in your changes missing coverage. Please review.

Project coverage is 85.74%. Comparing base (877716d) to head (41e0a05).
Report is 47 commits behind head on master.

Files with missing lines Patch % Lines
gwcs/wcs/_utils.py 85.24% 27 Missing ⚠️
gwcs/coordinate_frames.py 68.75% 15 Missing ⚠️
gwcs/wcs/_step.py 76.00% 12 Missing ⚠️
gwcs/wcs/_pipeline.py 95.05% 9 Missing ⚠️
gwcs/wcs/_wcs.py 91.48% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #545      +/-   ##
==========================================
+ Coverage   85.41%   85.74%   +0.32%     
==========================================
  Files          22       27       +5     
  Lines        3957     3991      +34     
==========================================
+ Hits         3380     3422      +42     
+ Misses        577      569       -8     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@WilliamJamieson WilliamJamieson marked this pull request as ready for review January 8, 2025 16:51
@WilliamJamieson WilliamJamieson requested a review from a team as a code owner January 8, 2025 16:51
@WilliamJamieson
Copy link
Collaborator Author

@WilliamJamieson WilliamJamieson requested a review from nden January 8, 2025 16:53
# Add the frame as an attribute of the pipeline
super().__setattr__(value.frame.name, value.frame)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried to use a __getattr__ method instead of this but it broke deep copies in some cases for JWST and Romancal regression tests.

Cadair added a commit to Cadair/ndcube that referenced this pull request Jan 14, 2025
Copy link
Collaborator

@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.

LGTM

@nden nden added this to the 0.23 milestone Jan 31, 2025
@nden nden merged commit a3d1cc0 into spacetelescope:master Jan 31, 2025
23 of 25 checks passed
@WilliamJamieson WilliamJamieson deleted the feature/pipeline branch June 4, 2025 15:54
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.

3 participants