MCPcopy Create free account
hub / github.com/pydata/xarray / test_binary

Function test_binary

xarray/tests/test_ufuncs.py:36–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34
35
36def test_binary():
37 args: list[int | float | npt.NDArray | xr.Variable | xr.DataArray | xr.Dataset] = [
38 0,
39 np.zeros(2),
40 xr.Variable(["x"], [0, 0]),
41 xr.DataArray([0, 0], dims="x"),
42 xr.Dataset({"y": ("x", [0, 0])}),
43 ]
44 for n, t1 in enumerate(args):
45 for t2 in args[n:]:
46 assert_identical(t2 + 1, np.maximum(t1, t2 + 1))
47 assert_identical(t2 + 1, np.maximum(t2, t1 + 1))
48 assert_identical(t2 + 1, np.maximum(t1 + 1, t2))
49 assert_identical(t2 + 1, np.maximum(t2 + 1, t1))
50
51
52def test_binary_out():

Callers

nothing calls this directly

Calls 1

assert_identicalFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…