Skip to content

Commit 1ac14bc

Browse files
authored
reorder np.nan replacement, np.maximum in sapm_spectral_loss (#608)
1 parent 7b17d62 commit 1ac14bc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ Enhancements
3939
* Created :py:func:`pvlib.iotools.read_surfrad` to read NOAA SURFRAD data. (:issue:`590`)
4040
* Created :py:func:`pvlib.iotools.read_midc` and :py:func:`pvlib.iotools.read_midc_raw_data_from_nrel`
4141
to read NREL MIDC data. (:issue:`601`)
42+
* Change :py:func:`pvlib.pvsystem.sapm_spectral_loss` to avoid numpy warning.
43+
4244

4345
Bug fixes
4446
~~~~~~~~~

pvlib/pvsystem.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1914,10 +1914,12 @@ def sapm_spectral_loss(airmass_absolute, module):
19141914
am_coeff = [module['A4'], module['A3'], module['A2'], module['A1'],
19151915
module['A0']]
19161916

1917-
spectral_loss = np.maximum(0, np.polyval(am_coeff, airmass_absolute))
1917+
spectral_loss = np.polyval(am_coeff, airmass_absolute)
19181918

19191919
spectral_loss = np.where(np.isnan(spectral_loss), 0, spectral_loss)
19201920

1921+
spectral_loss = np.maximum(0, spectral_loss)
1922+
19211923
if isinstance(airmass_absolute, pd.Series):
19221924
spectral_loss = pd.Series(spectral_loss, airmass_absolute.index)
19231925

0 commit comments

Comments
 (0)