Skip to content

Commit 0940c55

Browse files
committed
fix: adding exception if nsteps=0 or <0
1 parent fb450e0 commit 0940c55

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

LoopStructural/interpolators/supports/_3d_base_structured.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from LoopStructural.utils.exceptions import LoopException
12
import numpy as np
23
from LoopStructural.utils import getLogger
34
from . import SupportType
@@ -31,6 +32,10 @@ def __init__(
3132
self.type = SupportType.BaseStructured
3233
if np.any(step_vector == 0):
3334
logger.warning(f"Step vector {step_vector} has zero values")
35+
if np.any(nsteps == 0):
36+
raise LoopException("nsteps cannot be zero")
37+
if np.any(nsteps < 0):
38+
raise LoopException("nsteps cannot be negative")
3439
self._nsteps = np.array(nsteps, dtype=int) + 1
3540
self._step_vector = np.array(step_vector)
3641
self._origin = np.array(origin)

0 commit comments

Comments
 (0)