Skip to content

Commit ce01305

Browse files
committed
test_xarray_adios2: test the time array
1 parent 41a1a1a commit ce01305

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/test_xarray_adios2.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ def ds_pfd_moments_decoded(ds_pfd_moments_raw) -> xr.Dataset:
9696
return _decode_dataset(ds_pfd_moments_raw)
9797

9898

99+
@pytest.fixture
100+
def ds_with_time_arr():
101+
return pscpy.decode_psc(
102+
xr.open_dataset(pscpy.sample_dir / "pfd.000000000.bp"), ["e", "i"]
103+
)
104+
105+
99106
def test_open_dataset(ds_pfd_decoded):
100107
assert "jx_ec" in ds_pfd_decoded
101108
assert ds_pfd_decoded.coords.keys() == set({"x", "y", "z", "t"})
@@ -105,6 +112,10 @@ def test_open_dataset(ds_pfd_decoded):
105112
)
106113

107114

115+
def test_time_arr(ds_with_time_arr):
116+
assert np.isclose(ds_with_time_arr.time[0], 0.0)
117+
118+
108119
def test_component(ds_pfd_raw, ds_pfd_decoded):
109120
assert np.all(ds_pfd_raw.jeh.isel(dim_1_9=0).data == ds_pfd_decoded.jx_ec.data)
110121

0 commit comments

Comments
 (0)