8000 Numpy 2.0 compatibility (#2027) · sebastianzainali/pvlib-python@8668a61 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8668a61

Browse files
authored
Numpy 2.0 compatibility (pvlib#2027)
* change `np.Inf` to `np.inf` AttributeError: `np.Inf` was removed in the NumPy 2.0 release. Use `np.inf` instead. * change `np.NaN` to `np.nan` AttributeError: `np.NaN` was removed in the NumPy 2.0 release. Use `np.nan` instead. * fix np.uint8 range issue OverflowError: Python integer 450 out of bounds for uint8 * use `scipy.integrate.trapezoid` instead of `np.trapz` DeprecationWarning: `trapz` is deprecated. Use `trapezoid` instead, or one of the numerical integration functions in `scipy.integrate`. * advance minimum scipy from 1.5 to 1.6 for integrate.trapezoid * whatsnew PR number
1 parent 25ec296 commit 8668a61

19 files changed

+31
-25
lines changed

benchmarks/asv.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"build": "",
118118
"numpy": "1.17.5",
119119
"pandas": "1.3.0",
120-
"scipy": "1.5.0",
120+
"scipy": "1.6.0",
121121
// Note: these don't have a minimum in setup.py
122122
"h5py": "3.1.0",
123123
"ephem": "3.7.6.0",

ci/requirements-py3.10.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies:
2121
- python=3.10
2222
- pytz
2323
- requests
24-
- scipy >= 1.5.0
24+
- scipy >= 1.6.0
2525
- statsmodels
2626
- pip:
2727
- nrel-pysam>=2.0

ci/requirements-py3.11.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies:
2121
- python=3.11
2222
- pytz
2323
- requests
24-
- scipy >= 1.5.0
24+
- scipy >= 1.6.0
2525
- statsmodels
2626
- pip:
2727
- nrel-pysam>=2.0

ci/requirements-py3.12.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies:
2121
- python=3.12
2222
- pytz
2323
- requests
24-
- scipy >= 1.5.0
24+
- scipy >= 1.6.0
2525
- statsmodels
2626
- pip:
2727
- nrel-pysam>=2.0

ci/requirements-py3.7-min.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies:
1616
- h5py==3.1.0
1717
- numpy==1.17.3
1818
- pandas==1.3.0
19-
- scipy==1.5.0
19+
- scipy==1.6.0
2020
- pytest-rerunfailures # conda version is >3.6
2121
- pytest-remotedata # conda package is 0.3.0, needs > 0.3.1
2222
- requests-mock

ci/requirements-py3.7.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies:
2121
- python=3.7
2222
- pytz
2323
- requests
24-
- scipy >= 1.5.0
24+
- scipy >= 1.6.0
2525
- statsmodels
2626
- pip:
2727
- nrel-pysam>=2.0

ci/requirements-py3.8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies:
2121
- python=3.8
2222
- pytz
2323
- requests
24-
- scipy >= 1.5.0
24+
- scipy >= 1.6.0
2525
- statsmodels
2626
- pip:
2727
- nrel-pysam>=2.0

ci/requirements-py3.9.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies:
2121
- python=3.9
2222
- pytz
2323
- requests
24-
- scipy >= 1.5.0
24+
- scipy >= 1.6.0
2525
- statsmodels
2626
- pip:
2727
- nrel-pysam>=2.0

docs/sphinx/source/whatsnew/v0.10.5.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Documentation
3030

3131
Requirements
3232
~~~~~~~~~~~~
33+
* Minimum version of scipy advanced from 1.5.0 to 1.6.0. (:pull:`2027`)
3334

3435

3536
Contributors

pvlib/bifacial/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"""
55
import numpy as np
66
from pvlib.tools import sind, cosd, tand
7+
from scipy.integrate import trapezoid
78

89

910
def _solar_projection_tangent(solar_zenith, solar_azimuth, surface_azimuth):
@@ -220,7 +221,7 @@ def vf_ground_sky_2d_integ(surface_tilt, gcr, height, pitch, max_rows=10,
220221
vf = vf_ground_sky_2d(r, gcr, z, pitch, height, max_rows)
221222
fz_sky[:, k] = vf[:, 0] # remove spurious rotation dimension
222223
# calculate the integrated view factor for all of the ground between rows
223-
return np.trapz(fz_sky, z, axis=0)
224+
return trapezoid(fz_sky, z, axis=0)
224225

225226

226227
def _vf_poly(surface_tilt, gcr, x, delta):

0 commit comments

Comments
 (0)
0