Skip to content

Commit

Permalink
Fix devdeps build (#411)
Browse files Browse the repository at this point in the history
NDCube 2.2 has deprecated `ndcube.data.shape` and replaced it with
`ndcube.shape`, which is breaking `dataset.dimensions`.
  • Loading branch information
SolarDrew authored Jul 8, 2024
1 parent eca866b commit e7f7d8f
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions dkist/dataset/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,11 @@ def test_wcs_roundtrip_3d(dataset_3d):
assert_quantity_allclose(p[2], p2[2])


def test_dimensions(dataset, dataset_3d):
for ds in [dataset, dataset_3d]:
assert_quantity_allclose(ds.dimensions, ds.data.shape*u.pix)


def test_load_from_directory():
ds = load_dataset(rootdir / "EIT")
assert isinstance(ds.data, da.Array)
assert isinstance(ds.wcs, gwcs.WCS)
assert_quantity_allclose(ds.dimensions, (11, 128, 128)*u.pix)
assert_quantity_allclose(ds.data.shape, (11, 128, 128))
assert ds.files.basepath == Path(rootdir / "EIT")


Expand All @@ -99,14 +94,14 @@ def test_load_with_old_methods():
ds = Dataset.from_directory(rootdir / "EIT")
assert isinstance(ds.data, da.Array)
assert isinstance(ds.wcs, gwcs.WCS)
assert_quantity_allclose(ds.dimensions, (11, 128, 128)*u.pix)
assert_quantity_allclose(ds.data.shape, (11, 128, 128))
assert ds.files.basepath == Path(rootdir / "EIT")

with pytest.warns(DKISTDeprecationWarning):
ds = Dataset.from_asdf(rootdir / "EIT" / "eit_test_dataset.asdf")
assert isinstance(ds.data, da.Array)
assert isinstance(ds.wcs, gwcs.WCS)
assert_quantity_allclose(ds.dimensions, (11, 128, 128)*u.pix)
assert_quantity_allclose(ds.data.shape, (11, 128, 128))
assert ds.files.basepath == Path(rootdir / "EIT")


Expand Down

0 comments on commit e7f7d8f

Please sign in to comment.