Skip to content

Commit 10535e9

Browse files
committed
fix: cast to int64 and add positive nsteps check
1 parent 64e527b commit 10535e9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

LoopStructural/interpolators/supports/_3d_base_structured.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,12 @@ def maximum(self, maximum):
150150
maximum = np.array(maximum, dtype=float)
151151
length = maximum - self.origin
152152
length /= self.step_vector
153-
self._nsteps = np.ceil(length).astype(int) + 1
153+
self._nsteps = np.ceil(length).astype(np.int64) + 1
154+
if np.any(~(self._nsteps > 0)):
155+
logger.error(
156+
f"Cannot resize the interpolation support. The proposed number of steps is {self._nsteps}, these must be all > 0"
157+
)
158+
raise ValueError("Cannot resize the interpolation support.")
154159
self.onGeometryChange()
155160

156161
@property

0 commit comments

Comments
 (0)