From a6ae4975b68cddbc00dd12aec2c5c86827cebdb3 Mon Sep 17 00:00:00 2001 From: Taos Transue Date: Mon, 26 Jun 2023 12:46:15 -0700 Subject: [PATCH 1/4] add test --- pvlib/pvsystem.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index 86aa415bda..b3d7ac1d59 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -2459,6 +2459,7 @@ def singlediode(photocurrent, saturation_current, resistance_series, photovoltaic cell interconnection circuits" JW Bishop, Solar Cell (1988) https://doi.org/10.1016/0379-6787(88)90059-2 """ + I = 10 if ivcurve_pnts: warn_deprecated('0.10.0', name='pvlib.pvsystem.singlediode', alternative=('pvlib.pvsystem.v_from_i and ' From d17ff51ef52f16b46f05018d8ece303a55aa8c7a Mon Sep 17 00:00:00 2001 From: Taos Transue Date: Mon, 26 Jun 2023 13:18:12 -0700 Subject: [PATCH 2/4] add more stickler tests --- pvlib/pvsystem.py | 1 + pvlib/singlediode.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index b3d7ac1d59..0e05981b08 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -2461,6 +2461,7 @@ def singlediode(photocurrent, saturation_current, resistance_series, """ I = 10 if ivcurve_pnts: + print(I) warn_deprecated('0.10.0', name='pvlib.pvsystem.singlediode', alternative=('pvlib.pvsystem.v_from_i and ' 'pvlib.pvsystem.i_from_v'), diff --git a/pvlib/singlediode.py b/pvlib/singlediode.py index a4a760f1b9..0ef733fb9f 100644 --- a/pvlib/singlediode.py +++ b/pvlib/singlediode.py @@ -645,11 +645,11 @@ def _prepare_newton_inputs(i_or_v_tup, args, v0, method_kwargs): return args, v0, method_kwargs -def _lambertw_v_from_i(current, photocurrent, saturation_current, +def _lambertw_v_from_i(CURRENT, photocurrent, saturation_current, resistance_series, resistance_shunt, nNsVth): # Record if inputs were all scalar output_is_scalar = all(map(np.isscalar, - (current, photocurrent, saturation_current, + (CURRENT, photocurrent, saturation_current, resistance_series, resistance_shunt, nNsVth))) # This transforms Gsh=1/Rsh, including ideal Rsh=np.inf into Gsh=0., which @@ -660,7 +660,7 @@ def _lambertw_v_from_i(current, photocurrent, saturation_current, # Turns Series into arrays so that we don't have to worry about # multidimensional broadcasting failing I, IL, I0, Rs, Gsh, a = \ - np.broadcast_arrays(current, photocurrent, saturation_current, + np.broadcast_arrays(CURRENT, photocurrent, saturation_current, resistance_series, conductance_shunt, nNsVth) # Intitalize output V (I might not be float64) From 956d49a17c32678630f5b07c9be6d5f2a4d205a6 Mon Sep 17 00:00:00 2001 From: Taos Transue Date: Mon, 26 Jun 2023 13:32:31 -0700 Subject: [PATCH 3/4] add stickler test --- pvlib/singlediode.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pvlib/singlediode.py b/pvlib/singlediode.py index 0ef733fb9f..2901eb3aa6 100644 --- a/pvlib/singlediode.py +++ b/pvlib/singlediode.py @@ -645,11 +645,12 @@ def _prepare_newton_inputs(i_or_v_tup, args, v0, method_kwargs): return args, v0, method_kwargs -def _lambertw_v_from_i(CURRENT, photocurrent, saturation_current, +def _lambertw_v_from_i(current, photocurrent, saturation_current, resistance_series, resistance_shunt, nNsVth): + print('line too long aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') # Record if inputs were all scalar output_is_scalar = all(map(np.isscalar, - (CURRENT, photocurrent, saturation_current, + (current, photocurrent, saturation_current, resistance_series, resistance_shunt, nNsVth))) # This transforms Gsh=1/Rsh, including ideal Rsh=np.inf into Gsh=0., which @@ -660,7 +661,7 @@ def _lambertw_v_from_i(CURRENT, photocurrent, saturation_current, # Turns Series into arrays so that we don't have to worry about # multidimensional broadcasting failing I, IL, I0, Rs, Gsh, a = \ - np.broadcast_arrays(CURRENT, photocurrent, saturation_current, + np.broadcast_arrays(current, photocurrent, saturation_current, resistance_series, conductance_shunt, nNsVth) # Intitalize output V (I might not be float64) From e71f842a5a4af4e87a3de00046e0730b4881618d Mon Sep 17 00:00:00 2001 From: Taos Transue Date: Mon, 26 Jun 2023 13:41:01 -0700 Subject: [PATCH 4/4] clarify stickler test --- pvlib/singlediode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/singlediode.py b/pvlib/singlediode.py index 2901eb3aa6..992d4727c1 100644 --- a/pvlib/singlediode.py +++ b/pvlib/singlediode.py @@ -647,7 +647,6 @@ def _prepare_newton_inputs(i_or_v_tup, args, v0, method_kwargs): def _lambertw_v_from_i(current, photocurrent, saturation_current, resistance_series, resistance_shunt, nNsVth): - print('line too long aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') # Record if inputs were all scalar output_is_scalar = all(map(np.isscalar, (current, photocurrent, saturation_current, @@ -783,6 +782,7 @@ def _lambertw_i_from_v(voltage, photocurrent, saturation_current, def _lambertw(photocurrent, saturation_current, resistance_series, resistance_shunt, nNsVth, ivcurve_pnts=None): + print('line too long aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') # collect args params = {'photocurrent': photocurrent, 'saturation_current': saturation_current,