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

Method test_drop_encoding

xarray/tests/test_dataarray.py:302–319  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

300 assert expected2 is not self.dv.encoding
301
302 def test_drop_encoding(self) -> None:
303 array = self.mda
304 encoding = {"scale_factor": 10}
305 array.encoding = encoding
306 array["x"].encoding = encoding
307
308 assert array.encoding == encoding
309 assert array["x"].encoding == encoding
310
311 actual = array.drop_encoding()
312
313 # did not modify in place
314 assert array.encoding == encoding
315 assert array["x"].encoding == encoding
316
317 # variable and coord encoding is empty
318 assert actual.encoding == {}
319 assert actual["x"].encoding == {}
320
321 def test_constructor(self) -> None:
322 data = np.random.random((2, 3))

Callers

nothing calls this directly

Calls 1

drop_encodingMethod · 0.45

Tested by

no test coverage detected