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

Function test_scaling_offset_as_list

xarray/tests/test_coding.py:114–121  ·  view source on GitHub ↗
(scale_factor, add_offset)

Source from the content-addressed store, hash-verified

112@pytest.mark.parametrize("scale_factor", (10, [10]))
113@pytest.mark.parametrize("add_offset", (0.1, [0.1]))
114def test_scaling_offset_as_list(scale_factor, add_offset) -> None:
115 # test for #4631
116 encoding = dict(scale_factor=scale_factor, add_offset=add_offset)
117 original = xr.Variable(("x",), np.arange(10.0), encoding=encoding)
118 coder = variables.CFScaleOffsetCoder()
119 encoded = coder.encode(original)
120 roundtripped = coder.decode(encoded)
121 assert_allclose(original, roundtripped)
122
123
124@pytest.mark.parametrize("bits", [1, 2, 4, 8])

Callers

nothing calls this directly

Calls 4

encodeMethod · 0.95
decodeMethod · 0.95
assert_allcloseFunction · 0.90
arangeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…