Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ASDF mask serialization #1053

Merged
merged 1 commit into from
Apr 5, 2023
Merged

ASDF mask serialization #1053

merged 1 commit into from
Apr 5, 2023

Conversation

pllim
Copy link
Member

@pllim pllim commented Mar 30, 2023

Fix #1052

@braingram should also have a look to see if I did this wrong.

@pllim pllim added this to the v1.x milestone Mar 30, 2023
@codecov
Copy link

codecov bot commented Mar 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@2a7e5aa). Learn more about missing BASE report.
Report is 80 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1053   +/-   ##
=======================================
  Coverage        ?   70.19%           
=======================================
  Files           ?       64           
  Lines           ?     4412           
  Branches        ?        0           
=======================================
  Hits            ?     3097           
  Misses          ?     1315           
  Partials        ?        0           

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

@braingram
Copy link
Contributor

Overall these changes look good.

One thing to consider is how tag versioning will be handled. If a spectrum that contains a masked array is saved with an older version of specutils, the asdf file (with a 1.0.0 spectrum 1d tag) will not contain the mask (as noted in #1052). With the changes in this PR, the masked spectrum will be saved to the asdf file. However the file will contain the same 1.0.0 spectrum tag. If an older version of the software opens this newer file it will fail to load the mask and no errors or warnings will be raised (but the spectrum will not include the mask). If instead the tag was versioned (bumping it to 1.1.0) than specutils would generate a file with the 1.1.0 tag which would fail to convert for any older versions of specutils (and a AsdfConversionWarning would be issued). If this isn’t a concern (it looks like there has been no release since the converters were added) than a version increase doesn’t seem necessary.

@pllim
Copy link
Member Author

pllim commented Mar 31, 2023

I am not wise in the ways of ASDF, so I will have to defer to specutils maintainers about version bump or not.

@rosteen
Copy link
Contributor

rosteen commented Apr 5, 2023

I don't think it's needed right now, since as said we haven't actually released the converters.

Copy link
Contributor

@rosteen rosteen left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@rosteen rosteen merged commit 4c9672f into astropy:main Apr 5, 2023
@pllim pllim deleted the masked-asdf branch April 6, 2023 19:05
rosteen pushed a commit to rosteen/specutils that referenced this pull request Aug 15, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Round-trip mask through ASDF
3 participants