MCPcopy Index your code
hub / github.com/pydata/xarray / test_open_zarr_use_cftime

Method test_open_zarr_use_cftime

xarray/tests/test_backends.py:3703–3713  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3701
3702 @requires_cftime
3703 def test_open_zarr_use_cftime(self) -> None:
3704 ds = create_test_data()
3705 with self.create_zarr_target() as store_target:
3706 ds.to_zarr(store_target, **self.version_kwargs)
3707 ds_a = xr.open_zarr(store_target, **self.version_kwargs)
3708 assert_identical(ds, ds_a)
3709 decoder = CFDatetimeCoder(use_cftime=True)
3710 ds_b = xr.open_zarr(
3711 store_target, decode_times=decoder, **self.version_kwargs
3712 )
3713 assert xr.coding.times.contains_cftime_datetimes(ds_b.time.variable)
3714
3715 def test_write_read_select_write(self) -> None:
3716 # Test for https://github.com/pydata/xarray/issues/4084

Callers

nothing calls this directly

Calls 5

create_zarr_targetMethod · 0.95
assert_identicalFunction · 0.90
create_test_dataFunction · 0.85
CFDatetimeCoderClass · 0.85
to_zarrMethod · 0.45

Tested by

no test coverage detected