jablazek / FAST-PT

MIT License
1 stars 3 forks source link

Failures from scipy.integration function names deprecated in v1.14 #6

Open mcclearyj opened 2 months ago

mcclearyj commented 2 months ago

Hello,

While using the cosmosis-standard-library package, for which FAST-PT is a dependency, I encountered a problem due to the use of deprecated scipy.integrate function names in fastpt/matter_power_spt.py:

  File "/Users/j.mccleary/Software/miniconda3/envs/cosmosis/lib/python3.12/site-packages/fastpt/matter_power_spt.py", line 15, in <module>
    from scipy.integrate import trapz
ImportError: cannot import name 'trapz' from 'scipy.integrate' (/Users/j.mccleary/Software/miniconda3/envs/cosmosis/lib/python3.12/site-packages/scipy/integrate/__init__.py)

scipy.integrate.trapz appears to be deprecated in SciPy 1.14.0 and needs to be accessed with trapezoid instead. The fix is either small edit to matter_power_spt.py or just requiring SciPy 1.13 upon installation. If you are using Conda to manage the CosmoSIS installation, by default, it will install SciPy version 1.14.0 and FAST-PT version 3.1.1., baking in this error.

Since this error cropped up in at least one other place in the cosmosis-standard-library, I also noted the issue in that repository.

jablazek commented 2 months ago

Thanks both. This is fixed now in v3.1.3. The auto update to PyPi failed. I will investigate asap.

hsinfan1996 commented 2 months ago

Thanks both. This is fixed now in v3.1.3. The auto update to PyPi failed. I will investigate asap.

Not very sure, but do you need to change '3.1.2' to '3.1.3' in this line for uploading to pypi to work? https://github.com/jablazek/FAST-PT/blob/97d101d66b2d4ef6f72cd8d4b83735ce0184c14c/fastpt/info.py#L5