Skip to content

Commit a65c354

Browse files
committed
mypy updates
1 parent 81e3e91 commit a65c354

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ mpl-use-full-test-name = true
110110

111111
[tool.mypy]
112112
python_version = "3.11"
113-
plugins = ["numpy.typing.mypy_plugin"]
114113

115114
disallow_untyped_defs = true
116115
warn_return_any = true

src/emsarray/conventions/ugrid.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,10 @@ def integer_indexes(data_array: xarray.DataArray) -> numpy.ndarray:
12621262
del topology_variables
12631263

12641264
logger.debug("Slicing data variables...")
1265-
dimension_masks: dict[Hashable, numpy.ndarray] = {
1265+
dimension_masks: dict[Hashable, numpy.ndarray[
1266+
tuple[Any, ...],
1267+
numpy.dtype[numpy.bool[bool]],
1268+
] | numpy.bool[bool]] = {
12661269
topology.node_dimension: ~numpy.ma.getmask(new_node_indexes),
12671270
topology.face_dimension: ~numpy.ma.getmask(new_face_indexes),
12681271
}
@@ -1294,7 +1297,7 @@ def integer_indexes(data_array: xarray.DataArray) -> numpy.ndarray:
12941297
if dim in dimension_masks:
12951298
# ... make a tuple slice like (:, :, :, bool_array)
12961299
# where bool_array indicates which rows to include
1297-
slice_index = tuple([numpy.s_[:]] * index + [dimension_masks[dim]]) # type: ignore
1300+
slice_index = tuple([numpy.s_[:]] * index + [dimension_masks[dim]])
12981301
values = values[slice_index]
12991302

13001303
data_array = xarray.DataArray(data=values, dims=data_array.dims, name=name)

0 commit comments

Comments
 (0)