Skip to content

Commit

Permalink
Resolve other deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair committed Jan 21, 2025
1 parent a38d609 commit 6558e20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions dkist/io/asdf/converters/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def from_yaml_tree_transform(self, node, tag, ctx):
node["pc_table"] = u.Quantity(node["pc_table"].value, unit=u.pix)

return varying_celestial_transform_from_tables(
crpix=node["crpix"],
crpix_table=node["crpix"],
cdelt=node["cdelt"],
lon_pole=node["lon_pole"],
crval_table=node["crval_table"],
Expand All @@ -61,7 +61,7 @@ def from_yaml_tree_transform(self, node, tag, ctx):

def to_yaml_tree_transform(self, model, tag, ctx):
return {
"crpix": parameter_to_value(model.crpix),
"crpix": parameter_to_value(model.crpix_table),
"cdelt": parameter_to_value(model.cdelt),
"lon_pole": parameter_to_value(model.lon_pole),
"crval_table": parameter_to_value(model.crval_table),
Expand Down
16 changes: 8 additions & 8 deletions dkist/io/asdf/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_roundtrip_vct():
varying_matrix_lt = [rotation_matrix(a)[:2, :2]
for a in np.linspace(0, 90, 10)] * u.pix

vct = VaryingCelestialTransform(crpix=(5, 5) * u.pix,
vct = VaryingCelestialTransform(crpix_table=(5, 5) * u.pix,
cdelt=(1, 1) * u.arcsec/u.pix,
crval_table=(0, 0) * u.arcsec,
pc_table=varying_matrix_lt,
Expand All @@ -26,8 +26,8 @@ def test_roundtrip_vct():
new_ivct = roundtrip_object(vct.inverse)
assert isinstance(new_ivct, InverseVaryingCelestialTransform)

assert u.allclose(u.Quantity(new_vct.crpix), (5, 5) * u.pix)
assert u.allclose(u.Quantity(new_ivct.crpix), (5, 5) * u.pix)
assert u.allclose(u.Quantity(new_vct.crpix_table), (5, 5) * u.pix)
assert u.allclose(u.Quantity(new_ivct.crpix_table), (5, 5) * u.pix)

assert u.allclose(u.Quantity(new_vct.pc_table), varying_matrix_lt)
assert u.allclose(u.Quantity(new_ivct.pc_table), varying_matrix_lt)
Expand All @@ -43,7 +43,7 @@ def test_roundtrip_vct_2d():
varying_matrix_lt = [rotation_matrix(a)[:2, :2] for a in np.linspace(0, 90, 15)] * u.pix
varying_matrix_lt = varying_matrix_lt.reshape((5, 3, 2, 2))

vct = VaryingCelestialTransform2D(crpix=(5, 5) * u.pix,
vct = VaryingCelestialTransform2D(crpix_table=(5, 5) * u.pix,
cdelt=(1, 1) * u.arcsec/u.pix,
crval_table=(0, 0) * u.arcsec,
pc_table=varying_matrix_lt,
Expand All @@ -53,8 +53,8 @@ def test_roundtrip_vct_2d():
new_ivct = roundtrip_object(vct.inverse)
assert isinstance(new_ivct, InverseVaryingCelestialTransform2D)

assert u.allclose(u.Quantity(new_vct.crpix), (5, 5) * u.pix)
assert u.allclose(u.Quantity(new_ivct.crpix), (5, 5) * u.pix)
assert u.allclose(u.Quantity(new_vct.crpix_table), (5, 5) * u.pix)
assert u.allclose(u.Quantity(new_ivct.crpix_table), (5, 5) * u.pix)

assert u.allclose(u.Quantity(new_vct.pc_table), varying_matrix_lt)
assert u.allclose(u.Quantity(new_ivct.pc_table), varying_matrix_lt)
Expand All @@ -70,7 +70,7 @@ def test_roundtrip_vct_slit():
varying_matrix_lt = [rotation_matrix(a)[:2, :2]
for a in np.linspace(0, 90, 10)] * u.pix

vct = varying_celestial_transform_from_tables(crpix=(5, 5) * u.pix,
vct = varying_celestial_transform_from_tables(crpix_table=(5, 5) * u.pix,
cdelt=(1, 1) * u.arcsec/u.pix,
crval_table=(0, 0) * u.arcsec,
pc_table=varying_matrix_lt,
Expand All @@ -86,7 +86,7 @@ def test_roundtrip_vct_slit2d():
varying_matrix_lt = [rotation_matrix(a)[:2, :2] for a in np.linspace(0, 90, 15)] * u.pix
varying_matrix_lt = varying_matrix_lt.reshape((5, 3, 2, 2))

vct = varying_celestial_transform_from_tables(crpix=(5, 5) * u.pix,
vct = varying_celestial_transform_from_tables(crpix_table=(5, 5) * u.pix,
cdelt=(1, 1) * u.arcsec/u.pix,
crval_table=(0, 0) * u.arcsec,
pc_table=varying_matrix_lt,
Expand Down

0 comments on commit 6558e20

Please sign in to comment.