Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken examples #101

Open
z2v opened this issue Mar 30, 2015 · 6 comments
Open

Broken examples #101

z2v opened this issue Mar 30, 2015 · 6 comments
Labels

Comments

@z2v
Copy link
Collaborator

z2v commented Mar 30, 2015

These examples are broken on current master:

  • freefinger_noforce_radau.py
  • sloppycell_example.py

Git bisect points to commit 450c9f3.

@z2v z2v added the bug label Mar 30, 2015
@z2v
Copy link
Collaborator Author

z2v commented Mar 30, 2015

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.

@souravsingh
Copy link
Contributor

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

@z2v
Copy link
Collaborator Author

z2v commented Jan 28, 2016

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.

@robclewley
Copy link
Owner

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.

@z2v z2v changed the title New broken examples Broken examples Sep 7, 2018
@z2v
Copy link
Collaborator Author

z2v commented Sep 7, 2018

Broken examples at 3dbc42c 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

@davidcsterratt
Copy link

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 added a commit to davidcsterratt/pydstool that referenced this issue Oct 31, 2022
The function name "tau" collides with "math.tau", which ultimately
leads to a TypeError: 'float' object is not callable. This fix renames
"tau" to "tauw".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants