Skip to content

Commit

Permalink
avoid checking for equality of a list and string for custom yb_FoR input
Browse files Browse the repository at this point in the history
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
  • Loading branch information
kccwing authored Oct 18, 2024
1 parent b662a7f commit c89cd2e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sharpy/utils/generate_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,10 @@ def create_frame_of_reference_delta(self, y_BFoR='y_AFoR'):
y_BFoR (string): Direction of the yB axis
"""

if y_BFoR == 'x_AFoR':
if isinstance(y_BFoR,(list,np.ndarray)):
yB = np.asarray(y_BFoR)
cout.cout_wrap(("WARNING: custom FoR delta defined, using the given value: y_BFoR = {y_BFoR}" % (y_BFoR)), 3)
elif y_BFoR == 'x_AFoR':
yB = np.array([1.0, 0.0, 0.0])
elif y_BFoR == 'y_AFoR':
yB = np.array([0.0, 1.0, 0.0])
Expand Down

0 comments on commit c89cd2e

Please sign in to comment.