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

Method test_from_array_0d_object

xarray/tests/test_namedarray.py:309–321  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

307 assert named_array.dtype == dtype
308
309 def test_from_array_0d_object(self) -> None:
310 named_array: NamedArray[Any, Any]
311 named_array = from_array([], (10, 12, 12))
312 expected_data = np.empty((), dtype=object)
313 expected_data[()] = (10, 12, 12)
314 assert np.array_equal(np.asarray(named_array.data), expected_data)
315
316 assert named_array.dims == ()
317 assert named_array.sizes == {}
318 assert named_array.attrs == {}
319 assert named_array.ndim == 0
320 assert named_array.size == 1
321 assert named_array.dtype == np.dtype("O")
322
323 def test_from_array_0d_datetime(self) -> None:
324 named_array: NamedArray[Any, Any]

Callers

nothing calls this directly

Calls 3

from_arrayFunction · 0.90
emptyMethod · 0.80
dtypeMethod · 0.45

Tested by

no test coverage detected