File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/magpylib_material_response Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ def _convert_to_array(susceptibility, n):
6666 if (
6767 hasattr (susceptibility , "__len__" )
6868 and len (susceptibility ) == 3
69- and all (not isinstance (x , ( list , tuple , np .ndarray ) ) for x in susceptibility )
69+ and all (not isinstance (x , list | tuple | np .ndarray ) for x in susceptibility )
7070 ):
7171 # This is a 3-vector, not a list of 3 items
7272 susis = np .tile (susceptibility , (n , 1 ))
@@ -97,7 +97,7 @@ def _convert_to_array(susceptibility, n):
9797 sus_tuple = tuple (float (x ) for x in sus )
9898 except Exception as e :
9999 msg = f"Each element of susceptibility 3-vector must be numeric. Got: { sus !r} ({ e } )"
100- raise ValueError (msg )
100+ raise ValueError (msg ) from e
101101 susis .append (sus_tuple )
102102 else :
103103 msg = "susceptibility is not scalar or array of length 3"
You can’t perform that action at this time.
0 commit comments