pydstool icon indicating copy to clipboard operation
pydstool copied to clipboard

Broken examples

Open z2v opened this issue 9 years ago • 6 comments

These examples are broken on current master:

  • freefinger_noforce_radau.py
  • sloppycell_example.py

Git bisect points to commit 450c9f38dc3.

z2v avatar Mar 30 '15 15:03 z2v

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.

z2v avatar Mar 30 '15 16:03 z2v

So can the examples be fixed by just changing the names of the variables?

souravsingh avatar Jan 28 '16 07:01 souravsingh

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.

z2v avatar Jan 28 '16 07:01 z2v

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.

robclewley avatar Jan 28 '16 14:01 robclewley

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

z2v avatar Sep 07 '18 11:09 z2v

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

davidcsterratt avatar Oct 31 '22 10:10 davidcsterratt