Skip to content

dependency on an old scipy version #151

@g-puleo

Description

@g-puleo

Hi.
It looks like line 5 of this file is

from scipy.integrate import simps

which raises the following ImportError upon importing swyft (i was able to reproduce this error both with swyft==0.4.4 and 0.4.5 installed via pip).

>>> import swyft
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    import swyft
  File "/home/giammi/miniconda3/envs/empty/lib/python3.13/site-packages/swyft/__init__.py", line 1, in <module>
    from swyft.lightning.bounds import *
  File "/home/giammi/miniconda3/envs/empty/lib/python3.13/site-packages/swyft/lightning/__init__.py", line 1, in <module>
    from swyft.lightning.core import *
  File "/home/giammi/miniconda3/envs/empty/lib/python3.13/site-packages/swyft/lightning/core.py", line 34, in <module>
    from swyft.plot.mass import get_empirical_z_score
  File "/home/giammi/miniconda3/envs/empty/lib/python3.13/site-packages/swyft/plot/__init__.py", line 1, in <module>
    from swyft.plot.plot import (
    ...<5 lines>...
    )
  File "/home/giammi/miniconda3/envs/empty/lib/python3.13/site-packages/swyft/plot/plot.py", line 5, in <module>
    from scipy.integrate import simps
ImportError: cannot import name 'simps' from 'scipy.integrate' (/home/giammi/miniconda3/envs/empty/lib/python3.13/site-packages/scipy/integrate/__init__.py)
>>> 

The simps function was present up to scipy 1.5.4 and was later renamed to simpson, but the requirements only enforce scipy>=1.4.1, which allowed my pip to install scipy==1.16.0. I believe the easiest solution is to update the function name in the swyft source code.

I hope this is helpful :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions