Skip to content

Commit 945f050

Browse files
committed
patch mypy
1 parent 1272f3f commit 945f050

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

parcels/field.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
from .grid import Grid, GridType
5050

5151
if TYPE_CHECKING:
52+
import numpy.typing as npt
53+
5254
from parcels.fieldset import FieldSet
5355

5456
__all__ = ["Field", "NestedField", "VectorField"]
@@ -438,7 +440,7 @@ def from_netcdf(
438440
netcdf_engine = kwargs.pop("netcdf_engine", "netcdf4")
439441
gridindexingtype = kwargs.get("gridindexingtype", "nemo")
440442

441-
indices = {} # TODO Nick: Cleanup
443+
indices: dict[str, npt.NDArray] = {} # TODO Nick: Cleanup
442444

443445
interp_method: InterpMethod = kwargs.pop("interp_method", "linear")
444446
if type(interp_method) is dict:

parcels/fieldfilebuffer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,11 @@ def open_xarray_dataset(filename: Path | str, netcdf_engine: str) -> xr.Dataset:
181181
return ds
182182

183183

184-
def is_rectilinear(lon_subset: np.ndarray[float], lat_subset: np.ndarray[float]) -> bool:
185-
"""Test if all columns and rows are the same for lon and lat (in which case grid is rectilinear)"""
184+
def is_rectilinear(lon_subset, lat_subset) -> bool:
185+
"""Test if all columns and rows are the same for lon and lat (in which case grid is rectilinear).
186+
187+
lon_subset and lat_subset are 2D numpy arrays
188+
"""
186189
for xi in range(1, lon_subset.shape[0]):
187190
if not np.allclose(lon_subset[0, :], lon_subset[xi, :]):
188191
return False

0 commit comments

Comments
 (0)