(obj)
| 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) |
no test coverage detected
searching dependent graphs…