MCPcopy
hub / github.com/pydata/xarray / test_decode_cf

Method test_decode_cf

xarray/tests/test_backends_datatree.py:219–235  ·  view source on GitHub ↗
(self, tmpdir)

Source from the content-addressed store, hash-verified

217 assert_equal(original_dt, roundtrip_dt)
218
219 def test_decode_cf(self, tmpdir):
220 filepath = tmpdir / "test-cf-convention.nc"
221 original_dt = xr.DataTree(
222 xr.Dataset(
223 {
224 "test": xr.DataArray(
225 data=np.array([0, 1, 2], dtype=np.uint16),
226 attrs={"_FillValue": 99},
227 ),
228 }
229 )
230 )
231 original_dt.to_netcdf(filepath, engine=self.engine)
232 with open_datatree(
233 filepath, engine=self.engine, decode_cf=False
234 ) as roundtrip_dt:
235 assert original_dt["test"].dtype == roundtrip_dt["test"].dtype
236
237 def test_to_netcdf_inherited_coords(self, tmpdir) -> None:
238 filepath = tmpdir / "test.nc"

Callers

nothing calls this directly

Calls 2

to_netcdfMethod · 0.95
open_datatreeFunction · 0.90

Tested by

no test coverage detected