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

Function test_EncodedStringCoder_decode

xarray/tests/test_coding_strings.py:58–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56
57
58def test_EncodedStringCoder_decode() -> None:
59 coder = strings.EncodedStringCoder()
60
61 raw_data = np.array([b"abc", "ß∂µ∆".encode()])
62 raw = Variable(("x",), raw_data, {"_Encoding": "utf-8"})
63 actual = coder.decode(raw)
64
65 expected = Variable(("x",), np.array(["abc", "ß∂µ∆"], dtype=object))
66 assert_identical(actual, expected)
67
68 assert_identical(coder.decode(actual[0]), expected[0])
69
70
71@requires_dask

Callers

nothing calls this directly

Calls 4

decodeMethod · 0.95
VariableClass · 0.90
assert_identicalFunction · 0.90
encodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…