Skip to content

Commit a91eddb

Browse files
committed
Silence spurious mypy error
Numpy typing definitely still needs work, but I think this error has appeared as a result of changes in dependencies, and isn't real. `np.asarray` definitely returns an ndarray - though it is possible `np.ndarray` is not the right type annotation to use.
1 parent 2f3b4e2 commit a91eddb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/labthings_fastapi/types/numpy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def np_to_listoflists(arr: np.ndarray) -> NestedListOfNumbers:
6565

6666
def listoflists_to_np(lol: Union[NestedListOfNumbers, np.ndarray]) -> np.ndarray:
6767
"""Convert a list of lists to a numpy array (or pass-through ndarrays)"""
68-
return np.asarray(lol)
68+
return np.asarray(lol) # type: ignore[return-type]
6969

7070

7171
# Define an annotated type so Pydantic can cope with numpy

0 commit comments

Comments
 (0)