Skip to content

Commit 8195079

Browse files
committed
Cast signedinteger to int in _step
1 parent 8d3ca0f commit 8195079

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

stagpy/_step.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
if typing.TYPE_CHECKING:
2121
from typing import (Dict, Any, Mapping, List, Iterator, Tuple, Optional,
2222
Callable)
23-
from numpy import ndarray, signedinteger
23+
from numpy import ndarray
2424
from pandas import DataFrame, Series
2525
from .datatypes import Varf
2626
from .stagyydata import StagyyData
@@ -210,22 +210,22 @@ def threed(self) -> bool:
210210
"""Whether the grid is 3 dimensional."""
211211
return not self.twod
212212

213-
def at_z(self, zval: float) -> signedinteger:
213+
def at_z(self, zval: float) -> int:
214214
"""Return iz closest to given zval position.
215215
216216
In spherical geometry, the bottom boundary is considered to be at z=0.
217217
Use :meth:`at_r` to find a cell at a given radial position.
218218
"""
219219
if self.curvilinear:
220220
zval += self.rcmb
221-
return np.argmin(np.abs(self.z_centers - zval))
221+
return int(np.argmin(np.abs(self.z_centers - zval)))
222222

223-
def at_r(self, rval: float) -> signedinteger:
223+
def at_r(self, rval: float) -> int:
224224
"""Return ir closest to given rval position.
225225
226226
If called in cartesian geometry, this is equivalent to :meth:`at_z`.
227227
"""
228-
return np.argmin(np.abs(self.r_centers - rval))
228+
return int(np.argmin(np.abs(self.r_centers - rval)))
229229

230230

231231
class _Fields(abc.Mapping):

0 commit comments

Comments
 (0)