(
self,
dims: _DimsLike,
data: ArrayLike,
expected: np.ndarray[Any, Any],
raise_error: bool,
)
| 219 | ], |
| 220 | ) |
| 221 | def test_from_array( |
| 222 | self, |
| 223 | dims: _DimsLike, |
| 224 | data: ArrayLike, |
| 225 | expected: np.ndarray[Any, Any], |
| 226 | raise_error: bool, |
| 227 | ) -> None: |
| 228 | actual: NamedArray[Any, Any] |
| 229 | if raise_error: |
| 230 | with pytest.raises(TypeError, match="already a Named array"): |
| 231 | actual = from_array(dims, data) |
| 232 | |
| 233 | # Named arrays are not allowed: |
| 234 | from_array(actual) # type: ignore[call-overload] |
| 235 | else: |
| 236 | actual = from_array(dims, data) |
| 237 | |
| 238 | assert np.array_equal(np.asarray(actual.data), expected) |
| 239 | |
| 240 | def test_from_array_with_masked_array(self) -> None: |
| 241 | masked_array: np.ndarray[Any, np.dtype[np.generic]] |
nothing calls this directly
no test coverage detected