aplpy / aplpy

Astronomical Plotting Library in Python
http://aplpy.github.com
Other
169 stars 82 forks source link

Use FK4/FK5 instances instead of classes to get the equinox year #503

Open olebole opened 3 days ago

olebole commented 3 days ago

During a code reorganization in Astropy 6.1, the jyear/byear attribute is no longer a class attribute in astropy.coordinates.equinox, but only an instance attribute.

This makes a number of tests fail like

 _____________________________ test_beam_add_remove _____________________________
    def test_beam_add_remove():
>       f = FITSFigure(HDU)
[…]
>           equinox = "{:g}".format(FK5.equinox.jyear)
E           AttributeError: 'TimeAttribute' object has no attribute 'jyear'

/usr/lib/python3/dist-packages/aplpy/axis_labels.py:47: AttributeError

As discussed in https://github.com/astropy/astropy/issues/16654, the best way to fix it is here. Aside of adopting the (onforeseen) API change, it may be useful to take the possibily modified equinox time hear instead of the default one.

Closes: https://github.com/astropy/astropy/issues/16654