Function
test_coord_attrs
(
x,
expect_same_attrs: bool,
)
Source from the content-addressed store, hash-verified
| 1039 | ], |
| 1040 | ) |
| 1041 | def test_coord_attrs( |
| 1042 | x, |
| 1043 | expect_same_attrs: bool, |
| 1044 | ) -> None: |
| 1045 | base_attrs = dict(foo="bar") |
| 1046 | ds = xr.Dataset( |
| 1047 | data_vars=dict(a=2 * np.arange(5)), |
| 1048 | coords={"x": ("x", np.arange(5), base_attrs)}, |
| 1049 | ) |
| 1050 | |
| 1051 | has_same_attrs = ds.interp(x=x).x.attrs == base_attrs |
| 1052 | assert expect_same_attrs == has_same_attrs |
| 1053 | |
| 1054 | |
| 1055 | @requires_scipy |
Callers
nothing calls this directly
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…