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

AttributeError: 'RealDouble' object has no attribute 'real_part' #17

Closed
softimpulse opened this issue Feb 13, 2019 · 2 comments
Closed
Assignees
Labels

Comments

@softimpulse
Copy link

Might be this is just a simple usage error, a simple python test script throws an error:

Traceback (most recent call last):
  File "test.py", line 14, in <module>
    DDE.step_on_discontinuities()
  File "/home/ms/.local/lib/python3.6/site-packages/jitcdde/_jitcdde.py", line 906, in step_on_discontinuities
    for delay in self.delays
  File "/home/ms/.local/lib/python3.6/site-packages/jitcdde/_jitcdde.py", line 906, in <listcomp>
    for delay in self.delays
AttributeError: 'RealDouble' object has no attribute 'real_part'

my testfile is:

from jitcdde import jitcdde, y, t
import numpy

τ = 15
n = 10
β = 0.25
γ = 0.1

f = [ β * y(0,t-τ) / (1 + y(0,t-τ)**n) - γ*y(0) ]
DDE = jitcdde(f)

DDE.constant_past([1.0])

DDE.step_on_discontinuities()

data = []
for time in numpy.arange(DDE.t, DDE.t+10000, 10):
    data.append( DDE.integrate(time) )
numpy.savetxt("timeseries.dat", data)

And I am using newest versions by compiling from source with:

sudo apt install python3-numpy libgmp-dev  python3-pip cython3
sudo -H pip3 install --upgrade scipy sympy # mit oder ohne macht keinen Unterschied

git clone https://github.com/symengine/symengine.git && \
cd symengine/ && \
cmake . && \
make -j4 && \
sudo make install
# i'm going to install system wide
sudo -H pip3 install --upgrade git+git://github.com/symengine/symengine.py
# grab some coffee
sudo -H pip3 install --upgrade git+git://github.com/neurophysik/jitcxde_common git+git://github.com/neurophysik/jitcode git+git://github.com/neurophysik/jitcdde git+git://github.com/neurophysik/jitcsde
@Wrzlprmft
Copy link
Contributor

Wrzlprmft commented Feb 13, 2019

This seems to be a problem with some update of SymEngine. While I am trying to figure out the details and how to deal with them, you can solve your problem by installing the development version from PyPI via:

pip3 install symengine==0.3.1.dev1 --force-reinstall

@Wrzlprmft Wrzlprmft self-assigned this Feb 13, 2019
@Wrzlprmft Wrzlprmft added the bug label Feb 13, 2019
@softimpulse
Copy link
Author

Working now, THANKS!

I just had to use a slightly different command:

pip3 install -I symengine==0.3.1.dev1

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

2 participants