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

Method test_pad

xarray/tests/test_units.py:3170–3180  ·  view source on GitHub ↗
(self, dtype)

Source from the content-addressed store, hash-verified

3168 assert expected == actual
3169
3170 def test_pad(self, dtype):
3171 array = np.linspace(0, 5, 10).astype(dtype) * unit_registry.m
3172
3173 data_array = xr.DataArray(data=array, dims="x")
3174 units = extract_units(data_array)
3175
3176 expected = attach_units(strip_units(data_array).pad(x=(2, 3)), units)
3177 actual = data_array.pad(x=(2, 3))
3178
3179 assert_units_equal(expected, actual)
3180 assert_equal(expected, actual)
3181
3182 @pytest.mark.parametrize(
3183 "variant",

Callers

nothing calls this directly

Calls 9

padMethod · 0.95
assert_equalFunction · 0.90
extract_unitsFunction · 0.85
attach_unitsFunction · 0.85
strip_unitsFunction · 0.85
assert_units_equalFunction · 0.85
linspaceMethod · 0.80
astypeMethod · 0.45
padMethod · 0.45

Tested by

no test coverage detected