Skip to content

Commit

Permalink
Always use cftime
Browse files Browse the repository at this point in the history
  • Loading branch information
jbusecke committed Jun 12, 2024
1 parent 74dbb10 commit 17124f9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/test_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def ds_combined():
ds_list = []
for url in urls:
with fsspec.open(url) as f:
ds = xr.open_dataset(f).load() #workaround from https://github.com/fsspec/s3fs/issues/337
ds = xr.open_dataset(f, use_cftime=True).load() #workaround from https://github.com/fsspec/s3fs/issues/337
ds_list.append(ds)
return xr.combine_nested(
ds_list,
Expand Down Expand Up @@ -66,10 +66,9 @@ def clean_time(ds: xr.Dataset) -> xr.DataArray:
return ds.time.reset_coords(drop=True).load()
xr.testing.assert_identical(clean_time(ds), clean_time(ds_combined))

@pytest.mark.parametrize('use_cftime', [True, False])
@pytest.mark.parametrize('chunks', [None, {}])
def test_equal(vds_json, ds_combined, chunks, use_cftime):
ds = ds_from_json(vds_json, chunks=chunks, use_cftime=use_cftime)
def test_equal(vds_json, ds_combined, chunks):
ds = ds_from_json(vds_json, chunks=chunks, use_cftime=True)
ds = ds.load()
ds_combined = ds_combined.load()
print(f"{ds=}")
Expand Down

0 comments on commit 17124f9

Please sign in to comment.