-
Notifications
You must be signed in to change notification settings - Fork 76
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
Fix logic flow in _parse_hdulist for Cubeviz #2842
Fix logic flow in _parse_hdulist for Cubeviz #2842
Conversation
for Cubeviz
@@ -257,15 +257,13 @@ def _parse_hdulist(app, hdulist, file_name=None, | |||
if hdu.name != 'PRIMARY' and 'PRIMARY' in hdulist: | |||
metadata[PRIHDR_KEY] = standardize_metadata(hdulist['PRIMARY'].header) | |||
|
|||
sc = _return_spectrum_with_correct_units(flux, wcs, metadata, data_type, hdulist=hdulist) | |||
|
|||
# store original WCS in metadata. this is a hacky workaround for converting subsets | |||
# to sky regions, where the parent data of the subset might have dropped spatial WCS info | |||
metadata['_orig_spatial_wcs'] = _get_celestial_wcs(wcs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was added in #2496 by @cshanahan1 . I think the metadata
change here was a bit too late; should have been done before being passed into sc
.
app.add_data(sc, data_label) | ||
if data_type == 'flux': # Forced wave unit conversion made it lose stuff, so re-add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one was blamed to me back in #1480 but I have no recollection writing it... It was @javerbukh's PR so maybe he remembers why we did it this way or whether we can move it further down. 🤷♀️
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2842 +/- ##
==========================================
+ Coverage 88.94% 88.95% +0.01%
==========================================
Files 111 111
Lines 17101 17101
==========================================
+ Hits 15211 15213 +2
+ Misses 1890 1888 -2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the cleanup and tracing down the history. I think this all looks safe! 🤷♂️ 🤞
Description
Noticed these while investigating something else. Technically a bug but it is buried so deeply in the internals I don't think users would notice, so probably don't need a change log.
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts,list the proposed change log here for review and add to
CHANGES.rst
before merge. If no, maintainershould add a
no-changelog-entry-needed
label.Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.