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

Function stack_negative

xarray/tests/test_computation.py:498–505  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

496
497def test_apply_output_core_dimension() -> None:
498 def stack_negative(obj):
499 def func(x):
500 return np.stack([x, -x], axis=-1)
501
502 result = apply_ufunc(func, obj, output_core_dims=[["sign"]])
503 if isinstance(result, xr.Dataset | xr.DataArray):
504 result.coords["sign"] = [1, -1]
505 return result
506
507 array = np.array([[1, 2], [3, 4]])
508 variable = xr.Variable(["x", "y"], array)

Calls 1

apply_ufuncFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…