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

Function test_dimension_wo_coords

xarray/tests/test_interp.py:591–602  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

589
590@requires_scipy
591def test_dimension_wo_coords() -> None:
592 da = xr.DataArray(
593 np.arange(12).reshape(3, 4), dims=["x", "y"], coords={"y": [0, 1, 2, 3]}
594 )
595 da_w_coord = da.copy()
596 da_w_coord["x"] = np.arange(3)
597
598 assert_equal(da.interp(x=[0.1, 0.2, 0.3]), da_w_coord.interp(x=[0.1, 0.2, 0.3]))
599 assert_equal(
600 da.interp(x=[0.1, 0.2, 0.3], y=[0.5]),
601 da_w_coord.interp(x=[0.1, 0.2, 0.3], y=[0.5]),
602 )
603
604
605@requires_scipy

Callers

nothing calls this directly

Calls 5

copyMethod · 0.95
interpMethod · 0.95
assert_equalFunction · 0.90
arangeMethod · 0.80
interpMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…