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

Function test_alignment

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

Source from the content-addressed store, hash-verified

99
100
101def test_alignment():
102 ds1 = xr.Dataset({"a": ("x", [1, 2])}, {"x": [0, 1]})
103 ds2 = xr.Dataset({"a": ("x", [2, 3]), "b": 4}, {"x": [1, 2]})
104
105 actual = np.add(ds1, ds2)
106 expected = xr.Dataset({"a": ("x", [4])}, {"x": [1]})
107 assert_identical_(actual, expected)
108
109 with xr.set_options(arithmetic_join="outer"):
110 actual = np.add(ds1, ds2)
111 expected = xr.Dataset(
112 {"a": ("x", [np.nan, 4, np.nan]), "b": np.nan}, coords={"x": [0, 1, 2]}
113 )
114 assert_identical_(actual, expected)
115
116
117def test_kwargs():

Callers

nothing calls this directly

Calls 1

addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…