desihub / speclite

Lightweight utilities for working with spectroscopic data
14 stars 19 forks source link

Update scipy integration methods in filters.py #90

Closed michaelbuehlmann closed 3 months ago

michaelbuehlmann commented 4 months ago

Newer versions of Scipy have renamed the trapz and simps integration routines to trapezoid and simpson respectively. Currently, importing speclite.filter fails with those versions of scipy. Also see the SciPy issue.

This PR will check which variant of those methods is available.

michaelbuehlmann commented 4 months ago

I just noticed the other PR – I should have amended that one, I apologize. However, this PR should work with any scipy version

moustakas commented 4 months ago

Thanks for this contribution @michaelbuehlmann.

@sbailey I'm good with merging this because it maintains backwards compatibility (and I also need it with the more recent version of scipy I'm using on my laptop).

I haven't really dug into the test failures but I think those should be fixed separately.

michaelbuehlmann commented 4 months ago

Seems like the current errors are all similar to this:

AttributeError: module 'numpy.typing' has no attribute 'NDArray'. 

which is used in PIL.Image. NDArray is only available in numpy >= 1.21, but the CI script runs

python -m pip install 'numpy<1.21'
weaverba137 commented 3 months ago

Thank you again @michaelbuehlmann! This PR is now superseded by #91