Skip to content

Commit 48823fe

Browse files
committed
fix: strikedip2vector works for single floats not only list like
1 parent c049fa7 commit 48823fe

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

LoopStructural/utils/maths.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ def strikedip2vector(strike: NumericInput, dip: NumericInput) -> np.ndarray:
1919
_type_
2020
_description_
2121
"""
22+
if isinstance(strike, numbers.Number):
23+
strike = np.array([strike])
24+
else:
25+
strike = np.array(strike)
26+
if isinstance(dip, numbers.Number):
27+
dip = np.array([dip])
28+
else:
29+
dip = np.array(dip)
30+
2231
vec = np.zeros((len(strike), 3))
2332
s_r = np.deg2rad(strike)
2433
d_r = np.deg2rad((dip))

0 commit comments

Comments
 (0)