Skip to content

Commit

Permalink
Consistently check Dataset and DataTree equivalence
Browse files Browse the repository at this point in the history
  • Loading branch information
sjperkins committed Oct 7, 2024
1 parent 2012f1b commit 41752ae
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tests/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,14 @@ def test_open_dataset(simmed_ms):
with ExitStack() as stack:
ds = stack.enter_context(xarray.open_dataset(simmed_ms, chunks=chunks))
del ds.attrs["creation_date"]
xt.assert_equal(ds, mem_ds)
# assert ds.identical(mem_ds)
assert ds.identical(mem_ds)

# Works with a LocalCluster
with ExitStack() as stack:
cluster = stack.enter_context(LocalCluster(processes=True, n_workers=4))
stack.enter_context(Client(cluster))
ds = stack.enter_context(xarray.open_dataset(simmed_ms, chunks=chunks))
del ds.attrs["creation_date"]
xt.assert_equal(ds, mem_ds)
xt.assert_identical(ds, mem_ds)


Expand Down Expand Up @@ -161,7 +159,7 @@ def test_open_datatree(simmed_ms):
dt = open_datatree(simmed_ms, chunks=chunks)
for ds in dt.values():
del ds.attrs["creation_date"]
xt.assert_equal(dt, mem_dt)
xt.assert_identical(dt, mem_dt)

# Works with a LocalCluster
with ExitStack() as stack:
Expand All @@ -170,7 +168,6 @@ def test_open_datatree(simmed_ms):
dt = open_datatree(simmed_ms, chunks=chunks)
for ds in dt.values():
del ds.attrs["creation_date"]
xt.assert_equal(dt, mem_dt)
xt.assert_identical(dt, mem_dt)


Expand Down

0 comments on commit 41752ae

Please sign in to comment.