Skip to content

Commit 57f66c6

Browse files
committed
Fix support when building without numpy
1 parent 4cafd8b commit 57f66c6

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

symengine/lib/symengine_wrapper.pyx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,7 @@ def sympy2symengine(a, raise_error=False):
295295
return RealDouble(float(str(a)))
296296
ELSE:
297297
return RealDouble(float(str(a)))
298-
elif isinstance(a, np.float16):
299-
return RealDouble(a)
300-
elif isinstance(a, np.float32):
298+
elif have_numpy and isinstance(a, (np.float16, np.float32)):
301299
return RealDouble(a)
302300
elif a is sympy.I:
303301
return I
@@ -562,9 +560,7 @@ def _sympify(a, raise_error=True):
562560
return Integer(a)
563561
elif isinstance(a, float):
564562
return RealDouble(a)
565-
elif isinstance(a, np.float16):
566-
return RealDouble(a)
567-
elif isinstance(a, np.float32):
563+
elif have_numpy and isinstance(a, (np.float16, np.float32)):
568564
return RealDouble(a)
569565
elif isinstance(a, complex):
570566
return ComplexDouble(a)

0 commit comments

Comments
 (0)