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

Function original_and_stack_negative

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

Source from the content-addressed store, hash-verified

523 assert_identical(stacked_dataset, stack_negative(dataset.groupby("x")))
524
525 def original_and_stack_negative(obj):
526 def func(x):
527 return (x, np.stack([x, -x], axis=-1))
528
529 result = apply_ufunc(func, obj, output_core_dims=[[], ["sign"]])
530 if isinstance(result[1], xr.Dataset | xr.DataArray):
531 result[1].coords["sign"] = [1, -1]
532 return result
533
534 out0, out1 = original_and_stack_negative(array)
535 assert_identical(array, out0)

Callers 1

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…