Skip to content

Commit 17f7213

Browse files
committed
fix issue with scalars
1 parent 9f756bf commit 17f7213

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

pvlib/pvsystem.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2976,7 +2976,6 @@ def pvwatts_dc(effective_irradiance, temp_cell, pdc0, gamma_pdc, temp_ref=25.,
29762976
elif effective_irradiance > 200:
29772977
pdc_marion = pdc - (pdc0 * err_2)
29782978

2979-
29802979
# "cap" Marion's correction at 1000 W/m^2
29812980
if cap_adjustment:
29822981
if hasattr(effective_irradiance, '__len__'):
@@ -2987,7 +2986,11 @@ def pvwatts_dc(effective_irradiance, temp_cell, pdc0, gamma_pdc, temp_ref=25.,
29872986

29882987
# large k values can result in negative power at low irradiance, so
29892988
# set negative power to zero
2990-
pdc_marion[pdc_marion < 0] = 0
2989+
if hasattr(effective_irradiance, '__len__'):
2990+
pdc_marion[pdc_marion < 0] = 0
2991+
else:
2992+
if pdc_marion < 0:
2993+
pdc_marion = 0
29912994

29922995
pdc = pdc_marion
29932996

0 commit comments

Comments
 (0)