Skip to content

Commit 7039b11

Browse files
committed
Error for multiple output as_scipy
1 parent 8458a1f commit 7039b11

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

symengine/lib/symengine_wrapper.pyx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4609,6 +4609,8 @@ cdef class LambdaDouble(_Lambdify):
46094609
from ctypes import c_double, c_void_p, c_int, cast, POINTER, CFUNCTYPE
46104610
if not self.real:
46114611
raise RuntimeError("Lambda function has to be real")
4612+
if self.tot_out_size > 1:
4613+
raise RuntimeError("SciPy LowLevelCallable supports only functions with 1 output")
46124614
addr1 = cast(<size_t>&_scipy_callback_lambda_real,
46134615
CFUNCTYPE(c_double, c_int, POINTER(c_double), c_void_p))
46144616
addr2 = cast(<size_t>&self.lambda_double[0], c_void_p)
@@ -4632,6 +4634,8 @@ IF HAVE_SYMENGINE_LLVM:
46324634
from ctypes import c_double, c_void_p, c_int, cast, POINTER, CFUNCTYPE
46334635
if not self.real:
46344636
raise RuntimeError("Lambda function has to be real")
4637+
if self.tot_out_size > 1:
4638+
raise RuntimeError("SciPy LowLevelCallable supports only functions with 1 output")
46354639
addr1 = cast(<size_t>&_scipy_callback_lambda_real,
46364640
CFUNCTYPE(c_double, c_int, POINTER(c_double), c_void_p))
46374641
addr2 = cast(<size_t>&self.lambda_double[0], c_void_p)

0 commit comments

Comments
 (0)