Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed May 8, 2024
1 parent 03d2e09 commit e7ac491
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions glue/core/data_factories/tests/test_fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import numpy as np
from numpy.testing import assert_array_equal

from astropy.tests.helper import assert_quantity_allclose
from astropy.table import Table
from astropy.coordinates import SkyCoord
from astropy import units as u
Expand Down Expand Up @@ -249,10 +248,16 @@ def test_mixin_columns(tmp_path):

assert len(d.main_components) == 6

assert_quantity_allclose(d['coords.ra'], [1, 2, 3] * u.deg)
assert_quantity_allclose(d['coords.dec'], [4, 5, 6] * u.deg)
assert_quantity_allclose(d['coords.distance'], [1, 1, 1])

assert_quantity_allclose(d['coords_with_distance.ra'], [1, 2, 3] * u.deg)
assert_quantity_allclose(d['coords_with_distance.dec'], [4, 5, 6] * u.deg)
assert_quantity_allclose(d['coords_with_distance.distance'], [7, 8, 9] * u.kpc)
assert_array_equal(d['coords.l'], [1, 2, 3])
assert d.get_component('coords.l').units == 'deg'
assert_array_equal(d['coords.b'], [4, 5, 6])
assert d.get_component('coords.b').units == 'deg'
assert_array_equal(d['coords.distance'], [1, 1, 1])
assert d.get_component('coords.distance').units == ''

assert_array_equal(d['coords_with_distance.ra'], [1, 2, 3])
assert d.get_component('coords_with_distance.ra').units == 'deg'
assert_array_equal(d['coords_with_distance.dec'], [4, 5, 6])
assert d.get_component('coords_with_distance.dec').units == 'deg'
assert_array_equal(d['coords_with_distance.distance'], [7, 8, 9])
assert d.get_component('coords_with_distance.distance').units == 'kpc'

0 comments on commit e7ac491

Please sign in to comment.