lnls-fac / collective_effects

Python scripts to calculate and simulate collective effects
2 stars 2 forks source link

Import issue with last scipy verions #28

Open GamelinAl opened 1 month ago

GamelinAl commented 1 month ago

Hi,

Do you know that the code do not work with the last versions of scipy (>=1.14) ? Is there any reason to keep simps instead of simpson ? Or can it be changed without breaking things for you ?

>>> import pycolleff
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/dockeruser/collective_effects/pycolleff/pycolleff/__init__.py", line 7, in <module>
    from . import longitudinal_equilibrium
  File "/home/dockeruser/collective_effects/pycolleff/pycolleff/longitudinal_equilibrium.py", line 10, in <module>
    from scipy.integrate import quad as _quad, simps as _simps
ImportError: cannot import name 'simps' from 'scipy.integrate' (/home/dockeruser/miniconda3/lib/python3.11/site-packages/scipy/integrate/__init__.py)
>>> import scipy
>>> scipy.__version__
'1.14.1'
murilobalves commented 1 month ago

Hello @GamelinAl, thanks for pointing out the issue.

Yes I just notice this problem when running the script you shared in the mbtrack2 conda environment with newer scipy version. This could be fixed in this PR https://github.com/lnls-fac/collective_effects/pull/29 that is already merged into the master branch.

Thank you.