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

Method test_dims_setter

xarray/tests/test_namedarray.py:360–371  ·  view source on GitHub ↗
(
        self, dims: Any, data_shape: Any, new_dims: Any, raises: bool
    )

Source from the content-addressed store, hash-verified

358 ],
359 )
360 def test_dims_setter(
361 self, dims: Any, data_shape: Any, new_dims: Any, raises: bool
362 ) -> None:
363 named_array: NamedArray[Any, Any]
364 named_array = NamedArray(dims, np.asarray(np.random.random(data_shape)))
365 assert named_array.dims == tuple(dims)
366 if raises:
367 with pytest.raises(ValueError):
368 named_array.dims = new_dims
369 else:
370 named_array.dims = new_dims
371 assert named_array.dims == tuple(new_dims)
372
373 def test_duck_array_class(self) -> None:
374 numpy_a: NDArray[np.int64]

Callers

nothing calls this directly

Calls 1

NamedArrayClass · 0.90

Tested by

no test coverage detected