SciML / PyDSTool.jl

A wrapper for the Python PyDSTool library for the SciML Scientific Machine Learning organization
Other
7 stars 11 forks source link

PyDSTool error #15

Open Omer80 opened 5 years ago

Omer80 commented 5 years ago

I have tried to run the example for using PyDSTool and it gave me the following error message:

bif = bifurcation_curve(PC,"EP-C",["i"],
                               max_num_points=450,
                               max_stepsize=2,min_stepsize=1e-5,
                               stepsize=2e-2,loc_bif_points="all",
                               save_eigen=true,name="EQ1",
                               print_info=true,calc_stab=true)
ERROR: PyError ($(Expr(:escape, :(ccall(#= /home/ohm/.julia/packages/PyCall/0jMpb/src/pyfncall.jl:44 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'TypeError'>
TypeError("'float' object cannot be interpreted as an integer",)
  File "/home/ohm/.julia/conda/3/lib/python3.6/site-packages/PyDSTool/PyCont/Continuation.py", line 1246, in forward
    self._compute(v0=self.initdirec)
  File "/home/ohm/.julia/conda/3/lib/python3.6/site-packages/PyDSTool/PyCont/Continuation.py", line 1102, in _compute
    self._createTestFuncs()
  File "/home/ohm/.julia/conda/3/lib/python3.6/site-packages/PyDSTool/PyCont/Continuation.py", line 2035, in _createTestFuncs
    save=True, numpoints=self.MaxNumPoints+1)
  File "/home/ohm/.julia/conda/3/lib/python3.6/site-packages/PyDSTool/PyCont/TestFunc.py", line 719, in __init__
    BiAltMethod.__init__(self, (F.n, 1), F, C, save=save, numpoints=numpoints)
  File "/home/ohm/.julia/conda/3/lib/python3.6/site-packages/PyDSTool/PyCont/TestFunc.py", line 381, in __init__
    self.data.P = zeros((n*(n-1)/2, n*(n-1)/2), float)

Stacktrace:
 [1] pyerr_check at /home/ohm/.julia/packages/PyCall/0jMpb/src/exception.jl:60 [inlined]
 [2] pyerr_check at /home/ohm/.julia/packages/PyCall/0jMpb/src/exception.jl:64 [inlined]
 [3] macro expansion at /home/ohm/.julia/packages/PyCall/0jMpb/src/exception.jl:84 [inlined]
 [4] __pycall!(::PyObject, ::Ptr{PyCall.PyObject_struct}, ::PyObject, ::Ptr{Nothing}) at /home/ohm/.julia/packages/PyCall/0jMpb/src/pyfncall.jl:44
 [5] _pycall!(::PyObject, ::PyObject, ::Tuple{}, ::Int64, ::Ptr{Nothing}) at /home/ohm/.julia/packages/PyCall/0jMpb/src/pyfncall.jl:22
 [6] #call#89 at /home/ohm/.julia/packages/PyCall/0jMpb/src/pyfncall.jl:11 [inlined]
 [7] (::PyObject)() at /home/ohm/.julia/packages/PyCall/0jMpb/src/pyfncall.jl:89
 [8] #bifurcation_curve#5(::Int64, ::Int64, ::Float64, ::Float64, ::String, ::Bool, ::String, ::Bool, ::Bool, ::Float64, ::Float64, ::Float64, ::Nothing, ::Array{Symbol,1}, ::typeof(bifurcation_curve), ::PyObject, ::String, ::Array{String,1}) at /home/ohm/.julia/packages/PyDSTool/nreJ8/src/bifurcation.jl:107
 [9] (::getfield(PyDSTool, Symbol("#kw##bifurcation_curve")))(::NamedTuple{(:max_num_points, :max_stepsize, :min_stepsize, :stepsize, :loc_bif_points, :save_eigen, :name, :print_info, :calc_stab),Tuple{Int64,Int64,Float64,Float64,String,Bool,String,Bool,Bool}}, ::typeof(bifurcation_curve), ::PyObject, ::String, ::Array{String,1}) at ./none:0
 [10] top-level scope at none:0

julia>

What could be the problem?

ChrisRackauckas commented 5 years ago

Does ]test PyDSTool pass?

Omer80 commented 5 years ago

Using Pkg.test("PyDSTool") give me this message:

julia> import Pkg;Pkg.test("PyDSTool")
   Testing PyDSTool
 Resolving package versions...
    Status `/tmp/tmpR12BT9/Manifest.toml`
...
Calcium Direct: Error During Test at /home/ohm/.julia/packages/PyDSTool/nreJ8/test/runtests.jl:5
  Got exception outside of a @test
  LoadError: PyError ($(Expr(:escape, :(ccall(#= /home/ohm/.julia/packages/PyCall/0jMpb/src/pyfncall.jl:44 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'TypeError'>
  TypeError("'float' object cannot be interpreted as an integer",)
    File "/home/ohm/.julia/conda/3/lib/python3.6/site-packages/PyDSTool/PyCont/Continuation.py", line 1246, in forward
      self._compute(v0=self.initdirec)
    File "/home/ohm/.julia/conda/3/lib/python3.6/site-packages/PyDSTool/PyCont/Continuation.py", line 1102, in _compute
      self._createTestFuncs()
    File "/home/ohm/.julia/conda/3/lib/python3.6/site-packages/PyDSTool/PyCont/Continuation.py", line 2035, in _createTestFuncs
      save=True, numpoints=self.MaxNumPoints+1)
    File "/home/ohm/.julia/conda/3/lib/python3.6/site-packages/PyDSTool/PyCont/TestFunc.py", line 719, in __init__
      BiAltMethod.__init__(self, (F.n, 1), F, C, save=save, numpoints=numpoints)
    File "/home/ohm/.julia/conda/3/lib/python3.6/site-packages/PyDSTool/PyCont/TestFunc.py", line 381, in __init__
      self.data.P = zeros((n*(n-1)/2, n*(n-1)/2), float)
ChrisRackauckas commented 5 years ago

Julia v1.0+?

ChrisRackauckas commented 5 years ago

Looks like that's the same error CI is giving. Something is wrong with the installation. Maybe the binaries changed? @tkf might know.

tkf commented 5 years ago

My guess is that this is Python 2 vs 3 issue in integer division.

HenriLaurie commented 5 years ago

Might also be the same as issue #13 ... or closely related. I say this because we are also seeing these symptoms, from both issues.