pvlib / pvanalytics

Quality control, filtering, feature labeling, and other tools for working with data from photovoltaic energy systems.
https://pvanalytics.readthedocs.io
MIT License
97 stars 32 forks source link

Advance minimum scipy to 1.6 #205

Closed kandersolar closed 9 months ago

kandersolar commented 9 months ago

Recent CI runs show a deprecation warning from scipy: scipy.integrate.trapz is deprecated and replaced by scipy.integrate.trapezoid:

pvanalytics/tests/quality/test_irradiance.py: 24 warnings
  /opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/pandas/core/resample.py:450: DeprecationWarning: 'scipy.integrate.trapz' is deprecated in favour of 'scipy.integrate.trapezoid' and will be removed in SciPy 1.14.0
    func = lambda x: how(x, *args, **kwargs)

pvanalytics/tests/quality/test_irradiance.py::test_daily_insolation_limits_uneven
pvanalytics/tests/quality/test_irradiance.py::test_daily_insolation_limits_uneven
pvanalytics/tests/quality/test_irradiance.py::test_daily_insolation_limits_uneven
pvanalytics/tests/quality/test_irradiance.py::test_daily_insolation_limits_uneven
pvanalytics/tests/quality/test_irradiance.py::test_daily_insolation_limits_uneven
pvanalytics/tests/quality/test_irradiance.py::test_daily_insolation_limits_uneven
  /home/runner/work/pvanalytics/pvanalytics/pvanalytics/quality/irradiance.py:428: DeprecationWarning: 'scipy.integrate.trapz' is deprecated in favour of 'scipy.integrate.trapezoid' and will be removed in SciPy 1.14.0
    lambda day: integrate.trapz(y=day, x=hours[day.index])

We could work around the name change with try/except, but it's easiest to just increase our minimum scipy so that trapezoid is always available. Note that scipy 1.6.0 was released December 31, 2020.

kandersolar commented 9 months ago

Hearing no objections, in it goes!