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

Loosen check on coordinate class for NDData translator to accept subclasses #101

Merged
merged 2 commits into from
Aug 1, 2024

Conversation

bmorris3
Copy link
Contributor

The NDData translator checks that the Data.coords is either a WCS object, a glue Coordinates object, or None. Other Coordinates types are not allowed in the current logic. I'm trying to work with a case where the coordinate attribute that's an IdentityCoordinate, but that's disallowed.

This PR simply allows coords attributes that are subclasses of Coordinates.

@dhomeier dhomeier changed the title Loosen check on coordinate class for NDData translator Loosen check on coordinate class for NDData translator to accept subclasses Jul 31, 2024
@dhomeier
Copy link
Contributor

Thanks, this looks reasonable enough, and since you introduced the translator, I trust there are no issues to be worried about! Would it be possible, still, to add this as test case e.g. to test_to_ccddata?

Also, depending on whether you consider the previous refusal of subclasses a bug, this should be labelled as bug or enhancement for the automatic changelog.

@bmorris3
Copy link
Contributor Author

@dhomeier I've added a test. I'd consider this a bug. It makes sense for CCDData to enforce the coordinates to be relevant to observations from a CCD. NDData shouldn't make the same assumptions about the class used to define coordinates.

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.71%. Comparing base (5c91529) to head (a2bfe9a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #101      +/-   ##
==========================================
+ Coverage   96.69%   96.71%   +0.02%     
==========================================
  Files          18       18              
  Lines        1453     1462       +9     
==========================================
+ Hits         1405     1414       +9     
  Misses         48       48              

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

@dhomeier dhomeier added the bug Something isn't working label Jul 31, 2024
@dhomeier
Copy link
Contributor

Thanks! Could you rebase to get the other tests running?

Copy link
Contributor

@dhomeier dhomeier left a comment

Choose a reason for hiding this comment

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

Everything green, thanks!

@dhomeier dhomeier merged commit 43f0315 into glue-viz:main Aug 1, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants