pydstool
pydstool copied to clipboard
Broken examples
These examples are broken on current master
:
- freefinger_noforce_radau.py
- sloppycell_example.py
Git bisect points to commit 450c9f38dc3.
It seems, the problem is that these examples use i1
and j1
names for variables, which collide with scipy functions scipy.special.i1 and scipy.special.j1, respectively.
So can the examples be fixed by just changing the names of the variables?
Surely. The only thing to consider is that examples use a bunch of such variables (I1
, I2
, etc), so all of them should be fixed consistently.
I was trying a new way to organize the special names from scipy.special, and I put them in the "global" namespace of the vector field definition, rather than requiring them to be written special_i1
, etc. This makes access to the functions more obvious for new users and consistent with other PyDSTool provided built-in functions like min, sign, mod, and random. I'm not sure what the best design choice is here. There are likely to be some annoying clashes with common names like 'beta', 'i1', 'psi', y0', especially.
Broken examples at 3dbc42cc4f661368e464c1ae55e575b37912bad1 when running on Python 3.6.6:
- HH_model_testbounds.py
- PyCont_Hopfield.py
- PyCont_Logistic.py
- CIN.py
- freefinger_noforce_radau.py
- sloppycell_example.py
- PyCont_MorrisLecar_TypeI.py
- PyCont_MorrisLecar_TypeII.py
Yes, I am noticing the same thing with PyCont_MorrisLecar_TypeI.py. The error is
Traceback (most recent call last):
File "PyCont_MorrisLecar_TypeI_3.py", line 57, in <module>
PyCont['EQ1'].forward()
File "/home/dcs/miniconda3/envs/py3iaml/lib/python3.8/site-packages/PyDSTool/PyCont/Continuation.py", line 1245, in forward
self._compute(v0=self.initdirec)
File "/home/dcs/miniconda3/envs/py3iaml/lib/python3.8/site-packages/PyDSTool/PyCont/Continuation.py", line 1010, in _compute
J = self.CorrFunc.jac(x0)
File "/home/dcs/miniconda3/envs/py3iaml/lib/python3.8/site-packages/PyDSTool/PyCont/TestFunc.py", line 86, in __call__
self.lastval = self.func(*cargs)
File "/home/dcs/miniconda3/envs/py3iaml/lib/python3.8/site-packages/PyDSTool/PyCont/TestFunc.py", line 104, in diff
J[:,i] = (self.func(x0+eps*ei)-self.func(x0-eps*ei))/(2*eps)
File "/home/dcs/miniconda3/envs/py3iaml/lib/python3.8/site-packages/PyDSTool/PyCont/Continuation.py", line 455, in _system
return self.gensys.Rhs(t, VARS, self.parsdict, asarray=True)[self.varsindices]
File "/home/dcs/miniconda3/envs/py3iaml/lib/python3.8/site-packages/PyDSTool/Generator/Vode_ODEsystem.py", line 900, in Rhs
return getattr(self, self.funcspec.spec[1])(*[t, x, p + i])
File "<string>", line 3, in _specfn
TypeError: 'float' object is not callable