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

Method test_pad

xarray/tests/test_units.py:2239–2250  ·  view source on GitHub ↗
(self, mode, xr_arg, np_arg)

Source from the content-addressed store, hash-verified

2237 )
2238 @pytest.mark.parametrize("xr_arg, np_arg", _PAD_XR_NP_ARGS)
2239 def test_pad(self, mode, xr_arg, np_arg):
2240 data = np.arange(4 * 3 * 2).reshape(4, 3, 2) * unit_registry.m
2241 v = xr.Variable(["x", "y", "z"], data)
2242
2243 expected = attach_units(
2244 strip_units(v).pad(mode=mode, **xr_arg),
2245 extract_units(v),
2246 )
2247 actual = v.pad(mode=mode, **xr_arg)
2248
2249 assert_units_equal(expected, actual)
2250 assert_equal(actual, expected)
2251
2252 @pytest.mark.parametrize(
2253 "unit,error",

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected