Skip to content

Conversation

Cadair
Copy link
Member

@Cadair Cadair commented Sep 10, 2025

This is used quite heavily in ndcube.

I added use of the lazy fixtures package here, the test changes for SlicedLowLevelWCS are kind of related to #276 in that it makes it easy to also test with gwcs.

- type: object
properties:
wcs:
anyOf:
Copy link
Member Author

Choose a reason for hiding this comment

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

It would be really good to have a way of saying "Any APE-14 compliant WCS". I am kind of tempted to allow any object inside these WCS wrapper classes as we can't possibly enumerate all of them?

Now I think about it #276 has the same problem with the changes to the SlicedLowLeveWCS schema, we should be allowing all the NDCube wrappers there as well.

Copy link

codecov bot commented Sep 10, 2025

Codecov Report

❌ Patch coverage is 96.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.75%. Comparing base (97556cc) to head (f46c8e5).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...y/converters/wcs/tests/test_highlevelwcswrapper.py 94.44% 2 Missing ⚠️
asdf_astropy/testing/helpers.py 90.90% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (97556cc) and HEAD (f46c8e5). Click for more details.

HEAD has 5 uploads less than BASE
Flag BASE (97556cc) HEAD (f46c8e5)
8 3
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #296       +/-   ##
===========================================
- Coverage   99.39%   88.75%   -10.65%     
===========================================
  Files          65       68        +3     
  Lines        2326     2410       +84     
===========================================
- Hits         2312     2139      -173     
- Misses         14      271      +257     

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

@Cadair Cadair force-pushed the highlevelwcswrapper branch from 5493b18 to dd77e0e Compare September 10, 2025 09:55
@Cadair
Copy link
Member Author

Cadair commented Sep 10, 2025

Is this oldestdeps fail an asdf standard < 1.6 error? What's the best solution?

@Cadair Cadair force-pushed the highlevelwcswrapper branch 2 times, most recently from 01e4e5c to dc01b6c Compare September 10, 2025 14:03
Represents the FITS WCS object, the HDUlist of the FITS header is preserved
during serialization and during deserialization the WCS object is recreated
from the HDUlist.
- tag_uri: tag:astropy.org:astropy/wcs/highlevelwcswrapper-1.0.0
Copy link
Member Author

Choose a reason for hiding this comment

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

I had to add this here to make oldestdeps work. I'm not sure if it's a good idea or not though?

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's not change this and address the failures a different way. Do you have a link to the failures?

@braingram braingram mentioned this pull request Sep 10, 2025
@Cadair Cadair force-pushed the highlevelwcswrapper branch from dc01b6c to 9a89455 Compare September 10, 2025 14:31
af["hl_wcs"] = hl_wcs
af.write_to(file_path)

ll_wcs = hl_wcs._low_level_wcs
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a public way to get the low level wcs?

@braingram
Copy link
Contributor

More of a general question but what's the expectation here for HighLevelWCSWrapper? I'm not familiar with it but from the docstring and code (and name) it wraps a "low level" WCS and provides a different API. Structurally the only important information appears to be:

  • we have an instance of a HighLevelWCSWrapper
  • it has a low_level_wcs

I think the schema in this PR and the serialization structure are an accurate representation of that information. Given the relatively simple structure I'm wondering what benefit there is in all of the tests with GWCS instances. Does gwcs (or astropy) not already have tests that a GWCS instance can be used with HighLevelWCSWrapper? If not those tests would fit better in a different package. If so I question if we need to test that here. For constructing a HighLevelWCSWrapper we could just use an astropy WCS. Is there some nuance with HighLevelWCSWrapper and GWCS instances that wouldn't be covered by this option (dropping gwcs usage in this PR)?

@Cadair
Copy link
Member Author

Cadair commented Sep 10, 2025

gwcs.WCS and astropy.wcs.WCS both implement the high and low level APIs. Things such as the wrapper classes only implement the low level api so the high level wrapper gives you a way to get a high level object.

Yes probably we don't strictly need to test all combinations of things if it feels lile overkill 😆

@braingram
Copy link
Contributor

gwcs.WCS and astropy.wcs.WCS both implement the high and low level APIs. Things such as the wrapper classes only implement the low level api so the high level wrapper gives you a way to get a high level object.

Yes probably we don't strictly need to test all combinations of things if it feels lile overkill 😆

Thanks for the clarification. That sounds good to me. Would you update this PR dropping gwcs as a test dependency and making the required test changes?

@Cadair
Copy link
Member Author

Cadair commented Sep 11, 2025

Actually now I think about it, we don't test that gwcs.WCS is allowed in #276 for SlicedLowLevelWCS either. I kinda feel like if we have these wrapper classes which should allow serialising a wrapped gwcs object we should test it?

@braingram
Copy link
Contributor

Actually now I think about it, we don't test that gwcs.WCS is allowed in #276 for SlicedLowLevelWCS either. I kinda feel like if we have these wrapper classes which should allow serialising a wrapped gwcs object we should test it?

Thanks. I think the ideal situation would be that we could add gwcs as a test dependency and then test these cases (even though they're largely duplicating tests that hopefully exist already in gwcs). However adding gwcs as a test dependency is problematic since it has different minimum requirements and certain versions won't work here.

I'm not opposed to either:

  • not adding these wrapped gwcs tests (and not needing to add gwcs as a test dependency)
  • adding gwcs as a test dependency and skipping the gwcs-related testing for the minimum-deps run (perhaps similar to what's done in Test PR #298)

Which would you prefer?

@Cadair Cadair force-pushed the highlevelwcswrapper branch from 9a89455 to 10a4647 Compare October 7, 2025 15:40
@Cadair Cadair force-pushed the highlevelwcswrapper branch from 10a4647 to 9a1f9f8 Compare October 7, 2025 15:40
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.

2 participants