Skip to content

Commit bdb0126

Browse files
committed
Fixes typing issues that were resulting in mypy errors
1 parent 7ed4ec5 commit bdb0126

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

clouddrift/ragged.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -787,11 +787,11 @@ def subset(
787787

788788

789789
def unpack(
790-
ragged_array: np.ndarray,
791-
rowsize: np.ndarray[int],
790+
ragged_array: np.ndarray | xr.DataArray,
791+
rowsize: np.ndarray | xr.DataArray,
792792
rows: int | Iterable[int] = None,
793793
axis: int = 0,
794-
) -> list[np.ndarray]:
794+
) -> list[np.ndarray | xr.DataArray]:
795795
"""Unpack a ragged array into a list of regular arrays.
796796
797797
Unpacking a ``np.ndarray`` ragged array is about 2 orders of magnitude

tests/kinematics_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ def sample_ragged_array() -> RaggedArray:
2424
latitude = [[-90, -45, 45, 90, 0], [10, 20], [10, 20, 30, 40]]
2525
t = [[1, 2, 3, 4, 5], [4, 5], [2, 3, 4, 5]]
2626
test = [
27-
[True, True, True, False, False],
28-
[False, False],
29-
[True, False, False, False],
27+
[1, 1, 1, 0, 0],
28+
[0, 0],
29+
[1, 0, 0, 0],
3030
]
3131
rowsize = [len(x) for x in longitude]
3232
ids = [[d] * rowsize[i] for i, d in enumerate(drifter_id)]

tests/plotting_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import unittest
33
from unittest.mock import patch
44

5-
import cartopy.crs as ccrs
5+
import cartopy.crs as ccrs # type: ignore
66
import matplotlib.pyplot as plt
77
import numpy as np
88

0 commit comments

Comments
 (0)