-
-
Notifications
You must be signed in to change notification settings - Fork 127
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 with_spectral_unit
#1119
Fix with_spectral_unit
#1119
Conversation
Ok, I realized the existing WCS-initialized spectrum case was just acting on the |
return super().pixel_to_world(*args, **kwargs).to( | ||
self.original_unit, equivalencies=u.spectral()) | ||
|
||
|
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.
Perhaps just copy [pun-trigger!] over
https://github.com/astropy/astropy/blob/97bf1e123feec3170e2244964b0df2852b8e54e1/astropy/wcs/wcs.py#L633-L644
ff here as well for compatibility and to fix CI failure?
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.
Weird, I thought I ran the tests locally after adding that, guess not. Thanks for the link.
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.
Actually the tests do pass locally, I must have the IERS files cached.
Codestyle
5fb3f5d
to
0ff7bac
Compare
Looks like the remaining failures are a (hopefully transient) download failure:
|
Yes, seen those frequently, although they did not show up in the previous run; unlikely this was introduced by adding the copy methods. Can maybe check if astropy has done something to avoid these connection failures. |
Seems the last solution was just to wait till DNS is working again... astropy/astropy#15456 |
@dhomeier I switched to |
The test I did locally to verify it really needs |
Doesn't checking that the
The meta is an |
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.
Tried to set up an example of the deepcopy tests I commented on – setting Spectrum1D.meta
itself is not foolproof though, so one might argue it is the user's responsibility not to mess with (shallow-)copied instances.
Co-authored-by: Derek Homeier <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1119 +/- ##
==========================================
+ Coverage 70.89% 70.93% +0.03%
==========================================
Files 64 61 -3
Lines 4501 4221 -280
==========================================
- Hits 3191 2994 -197
+ Misses 1310 1227 -83 ☔ View full report in Codecov by Sentry. |
@dhomeier I did update the docstring already to explain what happens to the original WCS, is that enough to address the concern you brought up about documentation earlier today offline? |
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; leaving some final remarks on the docs, but this looks good now!
Co-authored-by: Derek Homeier <[email protected]>
Not sure – do we get
because that version is not in the online docs yet, or actually because But I am seeing other broken links into |
… references to SpectralRegion
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.
Original problem solved, new barrel opened!
And just seeing uncertainty.py
has an overwhich typo copied all over.
At least the docs are getting a good overhaul now. :D
@dhomeier After some tinkering I couldn't get that doc link to work (I was breaking more things...) so I decided to just make the docstring a little more descriptive here for now as a compromise. I pointed those other |
Sorry, was a bit too fast in committing then – maybe you should force-push again to revert. from specutils.spectra import SpectralRegion but this can wait for another PR as well. |
90f92c6
to
2e357c8
Compare
This has been needed for a long time - intended to fix #995 , #889 , #676. My current changes fix the behavior for a
Spectrum1D
initialized with aspectral_axis
, but I think it needs a little more work to also fix it for one initialized with awcs
. Note that this also moves theSpectralGWCS
out ofgwcs_from_array
so that it's actually accessible to check instances, since there are times we may want to do something different if that's the WCS type.