Skip to content

Commit 311781d

Browse files
authored
Docstring cleanup for pvlib.ivtools (#1765)
* fix paren placement * Raises section rendering fixes * add a bunch of DOIs
1 parent 5f6aef6 commit 311781d

File tree

3 files changed

+31
-21
lines changed

3 files changed

+31
-21
lines changed

pvlib/ivtools/sde.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ def fit_sandia_simple(voltage, current, v_oc=None, i_sc=None, v_mp_i_mp=None,
6464
6565
Raises
6666
------
67-
RuntimeError if parameter extraction is not successful.
67+
RuntimeError
68+
if parameter extraction is not successful.
6869
6970
Notes
7071
-----
@@ -124,8 +125,8 @@ def fit_sandia_simple(voltage, current, v_oc=None, i_sc=None, v_mp_i_mp=None,
124125
.. math::
125126
126127
\log(\beta_{0} - \beta_{1} V - I)
127-
&\approx \log(\frac{I_{0}}{1 + G_{p} R_{s}} + \frac{V}{nN_sV_{th}}
128-
+ \frac{I R_{s}}{nN_sV_{th}}) \\
128+
&\approx \log(\frac{I_{0}}{1 + G_{p} R_{s}}) + \frac{V}{nN_sV_{th}}
129+
+ \frac{I R_{s}}{nN_sV_{th}} \\
129130
&= \beta_{2} + \beta_{3} V + \beta_{4} I
130131
131132
6. Calculate values for ``IL, I0, Rs, Rsh,`` and ``nNsVth`` from the
@@ -139,7 +140,8 @@ def fit_sandia_simple(voltage, current, v_oc=None, i_sc=None, v_mp_i_mp=None,
139140
0 86758 909 4
140141
.. [2] C. B. Jones, C. W. Hansen, "Single Diode Parameter Extraction from
141142
In-Field Photovoltaic I-V Curves on a Single Board Computer", 46th IEEE
142-
Photovoltaic Specialist Conference, Chicago, IL, 2019
143+
Photovoltaic Specialist Conference, Chicago, IL, 2019.
144+
:doi:`10.1109/PVSC40753.2019.8981330`
143145
"""
144146

145147
# If not provided, extract v_oc, i_sc, v_mp and i_mp from the IV curve data
@@ -289,8 +291,10 @@ def _fit_sandia_cocontent(voltage, current, nsvth):
289291
290292
Raises
291293
------
292-
ValueError if ``voltage`` and ``current`` are different lengths.
293-
ValueError if ``len(voltage)`` < 6
294+
ValueError
295+
if ``voltage`` and ``current`` are different lengths.
296+
ValueError
297+
if ``len(voltage)`` < 6
294298
295299
Notes
296300
-----

pvlib/ivtools/sdm.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ def fit_cec_sam(celltype, v_mp, i_mp, v_oc, i_sc, alpha_sc, beta_voc,
7676
7777
Raises
7878
------
79-
ImportError if NREL-PySAM is not installed.
80-
81-
RuntimeError if parameter extraction is not successful.
79+
ImportError
80+
if NREL-PySAM is not installed.
81+
RuntimeError
82+
if parameter extraction is not successful.
8283
8384
Notes
8485
-----
@@ -94,7 +95,7 @@ def fit_cec_sam(celltype, v_mp, i_mp, v_oc, i_sc, alpha_sc, beta_voc,
9495
----------
9596
.. [1] A. Dobos, "An Improved Coefficient Calculator for the California
9697
Energy Commission 6 Parameter Photovoltaic Module Model", Journal of
97-
Solar Energy Engineering, vol 134, 2012.
98+
Solar Energy Engineering, vol 134, 2012. :doi:`10.1115/1.4005759`
9899
"""
99100

100101
try:
@@ -204,7 +205,7 @@ def fit_desoto(v_mp, i_mp, v_oc, i_sc, alpha_sc, beta_voc, cells_in_series,
204205
----------
205206
.. [1] W. De Soto et al., "Improvement and validation of a model for
206207
photovoltaic array performance", Solar Energy, vol 80, pp. 78-88,
207-
2006.
208+
2006. :doi:`10.1016/j.solener.2005.06.010`
208209
"""
209210

210211
# Constants
@@ -405,18 +406,21 @@ def fit_pvsyst_sandia(ivcurves, specs, const=None, maxiter=5, eps1=1.e-3):
405406
.. [1] K. Sauer, T. Roessler, C. W. Hansen, Modeling the Irradiance and
406407
Temperature Dependence of Photovoltaic Modules in PVsyst, IEEE Journal
407408
of Photovoltaics v5(1), January 2015.
409+
:doi:`10.1109/JPHOTOV.2014.2364133`
408410
.. [2] A. Mermoud, PV Modules modeling, Presentation at the 2nd PV
409411
Performance Modeling Workshop, Santa Clara, CA, May 2013
410412
.. [3] A. Mermoud, T. Lejeuene, Performance Assessment of a Simulation
411413
Model for PV modules of any available technology, 25th European
412414
Photovoltaic Solar Energy Conference, Valencia, Spain, Sept. 2010
413415
.. [4] C. Hansen, Estimating Parameters for the PVsyst Version 6
414416
Photovoltaic Module Performance Model, Sandia National Laboratories
415-
Report SAND2015-8598
417+
Report SAND2015-8598. :doi:`10.2172/1223058`
416418
.. [5] C. Hansen, Parameter Estimation for Single Diode Models of
417-
Photovoltaic Modules, Sandia National Laboratories Report SAND2015-2065
419+
Photovoltaic Modules, Sandia National Laboratories Report SAND2015-2065.
420+
:doi:`10.2172/1177157`
418421
.. [6] C. Hansen, Estimation of Parameters for Single Diode Models using
419422
Measured IV Curves, Proc. of the 39th IEEE PVSC, June 2013.
423+
:doi:`10.1109/PVSC.2013.6744135`
420424
.. [7] PVLib MATLAB https://github.com/sandialabs/MATLAB_PV_LIB
421425
"""
422426

@@ -574,11 +578,13 @@ def fit_desoto_sandia(ivcurves, specs, const=None, maxiter=5, eps1=1.e-3):
574578
----------
575579
.. [1] W. De Soto et al., "Improvement and validation of a model for
576580
photovoltaic array performance", Solar Energy, vol 80, pp. 78-88,
577-
2006.
581+
2006. :doi:`10.1016/j.solener.2005.06.010`
578582
.. [2] C. Hansen, Parameter Estimation for Single Diode Models of
579-
Photovoltaic Modules, Sandia National Laboratories Report SAND2015-2065
583+
Photovoltaic Modules, Sandia National Laboratories Report SAND2015-2065.
584+
:doi:`10.2172/1177157`
580585
.. [3] C. Hansen, Estimation of Parameters for Single Diode Models using
581586
Measured IV Curves, Proc. of the 39th IEEE PVSC, June 2013.
587+
:doi:`10.1109/PVSC.2013.6744135`
582588
.. [4] PVLib MATLAB https://github.com/sandialabs/MATLAB_PV_LIB
583589
"""
584590

pvlib/ivtools/utils.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ def rectify_iv_curve(voltage, current, decimals=None):
150150
``rectify_iv_curve`` ensures that the IV curve lies in the first quadrant
151151
of the (voltage, current) plane. The returned IV curve:
152152
153-
* increases in voltage
154-
* contains no negative current or voltage values
155-
* contains no NaNs
156-
* contains no points with duplicate voltage values. Where voltage
157-
values are repeated, a single data point is substituted with current
158-
equal to the average of current at duplicated voltages.
153+
* increases in voltage
154+
* contains no negative current or voltage values
155+
* contains no NaNs
156+
* contains no points with duplicate voltage values. Where voltage
157+
values are repeated, a single data point is substituted with current
158+
equal to the average of current at duplicated voltages.
159159
"""
160160

161161
df = pd.DataFrame(data=np.vstack((voltage, current)).T, columns=['v', 'i'])

0 commit comments

Comments
 (0)