FYI, the following example illustrates this issue:
from scipy.integrate import ode
y0, t0 = [1.0j, 2.0], 0
def f(t, y, arg1):
return [1j*arg1*y[0] + y[1], -arg1*y[1]**2]
def jac(t, y, arg1):
return [[1j*arg1, 1], [0, -arg1*2*y[1]]]
r = ode(f, jac).set_integrator('zvode', method='bdf')
r.set_initial_value(y0, t0).set_f_params(2.0).set_jac_params(2.0)
t1 = 10
dt = 1
while r.successful() and r.t < t1:
print(r.t+dt, r.integrate(r.t+dt))
From: William Hart <[email protected]>
Date: Friday, February 2, 2018 at 9:43 AM
To: "[email protected]" <[email protected]>
Cc: "Nicholson, Bethany L." <[email protected]>
Subject: Help with PyTuple_SetItem error
The CPython differences documentation here:
http://doc.pypy.org/en/latest/cpython_differences.html
References the exception `SystemError('PyTuple_SetItem called on tuple after
use of tuple")’ but it’s not clear when/why this exception gets triggered.
I’m trying to use scipy with pypy, and the ODE integrator is raising this
exception for code that works on CPython. I can’t figure out what I might
change in the configuration or the ODE integrator, or whether to conclude that
this is a bug in scipy’s compatibility with pypy.
Thanks,
--Bill
_______________________________________________
pypy-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-dev