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

Method test_drop_encoding

xarray/tests/test_variable.py:476–491  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

474 assert expected.encoding == actual.encoding
475
476 def test_drop_encoding(self) -> None:
477 encoding1 = {"scale_factor": 1}
478 # encoding set via cls constructor
479 v1 = self.cls(["a"], [0, 1, 2], encoding=encoding1)
480 assert v1.encoding == encoding1
481 v2 = v1.drop_encoding()
482 assert v1.encoding == encoding1
483 assert v2.encoding == {}
484
485 # encoding set via setter
486 encoding3 = {"scale_factor": 10}
487 v3 = self.cls(["a"], [0, 1, 2], encoding=encoding3)
488 assert v3.encoding == encoding3
489 v4 = v3.drop_encoding()
490 assert v3.encoding == encoding3
491 assert v4.encoding == {}
492
493 def test_concat(self):
494 x = np.arange(5)

Callers

nothing calls this directly

Calls 2

clsMethod · 0.45
drop_encodingMethod · 0.45

Tested by

no test coverage detected