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

Astropy/6.0.0 issue with coordinates breaks test units for jura production #157

Closed
araichoor opened this issue Apr 18, 2024 · 1 comment
Closed

Comments

@araichoor
Copy link
Contributor

Unit tests for the jura production currently fail:

FAILED py/desisurvey/test/test_utils.py::TestUtils::test_get_airmass_always_visible
FAILED py/desisurvey/test/test_utils.py::TestUtils::test_get_airmass_lowest
FAILED py/desisurvey/test/test_utils.py::TestUtils::test_get_observer_to_sky

From the log, it s the same failure for all three cases and, If I m correct, the reason is astropy/6.0.0.
And, actually, in astropy/5.2.1, there is a WARNING, saying that the considered call won t be supported in the future.

e.g.:

this works fine with astropy/5.2.1 (but raises a WARNING):

import astropy
astropy.__version__
# => '5.2.1'
from astropy import units as u
from desisurvey import utils
t = astropy.time.Time('2020-01-01')
o = utils.get_observer(t, alt=90 * u.deg, az=0 * u.deg)
o.__class__, astropy.coordinates.ICRS.__class__
# => (<class 'astropy.coordinates.builtin_frames.altaz.AltAz'>, <class 'abc.ABCMeta'>)
o.transform_to(astropy.coordinates.ICRS)
# =>
WARNING: AstropyDeprecationWarning: Transforming a frame instance to a frame class (as opposed to another frame instance) will not be supported in the future.  Either explicitly instantiate the target frame, or first convert the source frame instance to a `astropy.coordinates.SkyCoord` and use its `transform_to()` method. [astropy.coordinates.baseframe]
<ICRS Coordinate: (ra, dec) in deg
    (348.28121199, 31.85415575)>

but fails with astropy/6.0.0 (same error than what s reported in the unit tests log):

import astropy
astropy.__version__
# => '6.0.0'
from astropy import units as u
from desisurvey import utils
t = astropy.time.Time('2020-01-01')
o = utils.get_observer(t, alt=90 * u.deg, az=0 * u.deg)
o.__class__, astropy.coordinates.ICRS.__class__
# => (<class 'astropy.coordinates.builtin_frames.altaz.AltAz'>, <class 'abc.ABCMeta'>)
o.transform_to(astropy.coordinates.ICRS)
# =>
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/global/common/software/desi/perlmutter/desiconda/20240322-2.2.0/conda/lib/python3.10/site-packages/astropy/coordinates/baseframe.py", line 1272, in transform_to
    raise ConvertError(msg.format(self.__class__, new_frame.__class__))
astropy.coordinates.errors.ConvertError: Cannot transform from <class 'astropy.coordinates.builtin_frames.altaz.AltAz'> to <class 'abc.ABCMeta'>

@schlafly , @weaverba137 : I m not super-familiar with those subtleties, so it would be great if you can have a look at that; thanks!

if useful:

@schlafly
Copy link
Contributor

I think this is addressed in #158 but I had to loosen the tolerances there a little bit, which is awkward.

@sbailey sbailey closed this as completed Apr 30, 2024
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

No branches or pull requests

3 participants