File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -697,7 +697,7 @@ def _lambdifygenerated(x):
697
697
else :
698
698
modules = ["numpy" ]
699
699
else :
700
- modules = ["scipy " , "numpy " ]
700
+ modules = ["numpy " , "scipy " ]
701
701
702
702
# Get the needed namespaces.
703
703
namespaces = []
Original file line number Diff line number Diff line change @@ -1012,10 +1012,11 @@ def test_scipy_fns():
1012
1012
f = lambdify (x , sympy_fn (x ), modules = "scipy" )
1013
1013
for i in range (20 ):
1014
1014
tv = numpy .random .uniform (- 10 , 10 ) + 1j * numpy .random .uniform (- 5 , 5 )
1015
- # SciPy thinks that factorial(z) is 0 when re(z) < 0.
1015
+ # SciPy thinks that factorial(z) is 0 when re(z) < 0 and
1016
+ # does not support complex numbers.
1016
1017
# SymPy does not think so.
1017
- if sympy_fn == factorial and numpy . real ( tv ) < 0 :
1018
- tv = tv + 2 * numpy .abs (numpy . real ( tv ) )
1018
+ if sympy_fn == factorial :
1019
+ tv = numpy .abs (tv )
1019
1020
# SciPy supports gammaln for real arguments only,
1020
1021
# and there is also a branch cut along the negative real axis
1021
1022
if sympy_fn == loggamma :
You can’t perform that action at this time.
0 commit comments