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

Method test_matmul_align_coords

xarray/tests/test_dataarray.py:4444–4462  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4442 assert_identical(result, expected)
4443
4444 def test_matmul_align_coords(self) -> None:
4445 # GH 3694
4446
4447 x_a = np.arange(6)
4448 x_b = np.arange(2, 8)
4449 da_vals = np.arange(6)
4450 da_a = DataArray(da_vals, coords=[x_a], dims=["x"])
4451 da_b = DataArray(da_vals, coords=[x_b], dims=["x"])
4452
4453 # only test arithmetic_join="inner" (=default)
4454 result = da_a @ da_b
4455 expected = da_a.dot(da_b)
4456 assert_identical(result, expected)
4457
4458 with xr.set_options(arithmetic_join="exact"):
4459 with pytest.raises(
4460 ValueError, match=r"cannot align.*join.*exact.*not equal.*"
4461 ):
4462 da_a @ da_b
4463
4464 def test_binary_op_propagate_indexes(self) -> None:
4465 # regression test for GH2227

Callers

nothing calls this directly

Calls 4

dotMethod · 0.95
DataArrayClass · 0.90
assert_identicalFunction · 0.90
arangeMethod · 0.80

Tested by

no test coverage detected