Skip to content

Commit 5f7e9d6

Browse files
kevinsa5wholmgren
authored andcommitted
Docstring formatting (#833)
* improve docstring sphinx rendering in ModelChain methods * improve docstring sphinx rendering in Location.from_tmy * improve docstring sphinx rendering in tracking.singleaxis * improve docstring sphinx rendering in iotools.midc.read_midc * improve docstring sphinx rendering in ivtools functions * remove duplicate pvwatts_losses entry in api.rst * improve docstring sphinx rendering in clearsky functions * add whatsnew entry * update formatting of "Assigns attributes" info in modelchain.py docstrings * fix capitalization in iotools.midc.read_midc * improve docstring formatting for return value dict keys in ivtools.fit_sdm_desoto * simplify Location.from_tmy docstring * pin sphinx version at 1.8.5 in setup.py * make solarposition.py footnotes compatible with numpydoc * make clearsky.py footnotes compatible with numpydoc * make atmosphere.py footnotes compatible with numpydoc * make irradiance.py footnotes compatible with numpydoc * make iam.py footnotes compatible with numpydoc * make temperature.py footnotes compatible with numpydoc * make pvsystem.py footnotes compatible with numpydoc * make singlediode.py footnotes compatible with numpydoc * make ivtools.py footnotes compatible with numpydoc * make tracking.py footnotes compatible with numpydoc * make tmy.py footnotes compatible with numpydoc * make epw.py footnotes compatible with numpydoc * make srml.py footnotes compatible with numpydoc * make surfrad.py footnotes compatible with numpydoc * make psm3.py footnotes compatible with numpydoc * fix typo in pvsyst_cell docstring footnote * add sphinx suppress_warnings entry for unreferenced footnote warnings * make the stickler happy * fix improper reference format in pvsystem.calcparams_pvsyst docstring * remove TMY module from api.rst and add pvsystem.adrinverter * add link to github issue about suppressing sphinx warnings Co-Authored-By: Will Holmgren <[email protected]> * fix lint issue in pvsystem.py and make pvsystem.adrinverter docstring reference numpydoc compliant
1 parent b26ef22 commit 5f7e9d6

22 files changed

+632
-631
lines changed

docs/sphinx/source/api.rst

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ Functions relevant for the SAPM model.
275275
pvsystem.sapm_spectral_loss
276276
pvsystem.sapm_aoi_loss
277277
pvsystem.snlinverter
278+
pvsystem.adrinverter
278279
temperature.sapm_cell
279280

280281
Pvsyst model
@@ -296,7 +297,6 @@ PVWatts model
296297
pvsystem.pvwatts_dc
297298
pvsystem.pvwatts_ac
298299
pvsystem.pvwatts_losses
299-
pvsystem.pvwatts_losses
300300

301301
Functions for fitting PV models
302302
-------------------------------
@@ -380,24 +380,6 @@ in some files.
380380
location.Location.from_epw
381381

382382

383-
TMY
384-
===
385-
386-
.. warning::
387-
388-
The :py:mod:`pvlib.tmy` module is deprecated; it will be removed
389-
in pvlib 0.7. Please see the :ref:`pvlib.iotools <iotools>` package.
390-
391-
Methods and functions for reading data from TMY files.
392-
393-
.. autosummary::
394-
:toctree: generated/
395-
396-
location.Location.from_tmy
397-
tmy.readtmy2
398-
tmy.readtmy3
399-
400-
401383
Forecasting
402384
===========
403385

docs/sphinx/source/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,3 +320,7 @@ def setup(app):
320320
nbsphinx_allow_errors = True
321321

322322
ipython_warning_is_error = False
323+
324+
# suppress "WARNING: Footnote [1] is not referenced." messages
325+
# https://github.com/pvlib/pvlib-python/issues/837
326+
suppress_warnings = ['ref.footnote']

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ Documentation
177177
used. (:issue:`785`)
178178
* Note warning about _TMY3.epw files retrieved from energyplus.net in docstring
179179
of `epw.read_epw`
180+
* Improved sphinx rendering of API reference entries for `clearsky.ineichen`,
181+
`clearsky.haurwitz`, `tracking.singleaxis`, `iotools.read_midc`,
182+
`Location.from_tmy`, `ModelChain.run_model`, `ModelChain.complete_irradiance`,
183+
and `ModelChain.prepare_inputs`
184+
* Removed duplicate `pvwatts_losses` entry in `api.rst`
180185

181186
Removal of prior version deprecations
182187
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -212,3 +217,4 @@ Contributors
212217
* Tony Lorenzo (:ghuser:`alorenzo175`)
213218
* Todd Karin (:ghuser:`toddkarin`)
214219
* Mark Mikofski (:ghuser:`mikofski`)
220+
* Kevin Anderson (:ghuser:`kevinsa5`)

pvlib/atmosphere.py

Lines changed: 65 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def pres2alt(pressure):
4646
4747
References
4848
-----------
49-
[1] "A Quick Derivation relating altitude to air pressure" from
50-
Portland State Aerospace Society, Version 1.03, 12/22/2004.
49+
.. [1] "A Quick Derivation relating altitude to air pressure" from
50+
Portland State Aerospace Society, Version 1.03, 12/22/2004.
5151
'''
5252

5353
alt = 44331.5 - 4946.62 * pressure ** (0.190263)
@@ -86,8 +86,8 @@ def alt2pres(altitude):
8686
8787
References
8888
-----------
89-
[1] "A Quick Derivation relating altitude to air pressure" from
90-
Portland State Aerospace Society, Version 1.03, 12/22/2004.
89+
.. [1] "A Quick Derivation relating altitude to air pressure" from
90+
Portland State Aerospace Society, Version 1.03, 12/22/2004.
9191
'''
9292

9393
press = 100 * ((44331.514 - altitude) / 11880.516) ** (1 / 0.1902632)
@@ -124,9 +124,9 @@ def get_absolute_airmass(airmass_relative, pressure=101325.):
124124
125125
References
126126
----------
127-
[1] C. Gueymard, "Critical analysis and performance assessment of
128-
clear sky solar irradiance models using theoretical and measured
129-
data," Solar Energy, vol. 51, pp. 121-138, 1993.
127+
.. [1] C. Gueymard, "Critical analysis and performance assessment of
128+
clear sky solar irradiance models using theoretical and measured
129+
data," Solar Energy, vol. 51, pp. 121-138, 1993.
130130
'''
131131

132132
airmass_absolute = airmass_relative * pressure / 101325.
@@ -178,29 +178,29 @@ def get_relative_airmass(zenith, model='kastenyoung1989'):
178178
179179
References
180180
----------
181-
[1] Fritz Kasten. "A New Table and Approximation Formula for the
182-
Relative Optical Air Mass". Technical Report 136, Hanover, N.H.:
183-
U.S. Army Material Command, CRREL.
181+
.. [1] Fritz Kasten. "A New Table and Approximation Formula for the
182+
Relative Optical Air Mass". Technical Report 136, Hanover, N.H.:
183+
U.S. Army Material Command, CRREL.
184184
185-
[2] A. T. Young and W. M. Irvine, "Multicolor Photoelectric
186-
Photometry of the Brighter Planets," The Astronomical Journal, vol.
187-
72, pp. 945-950, 1967.
185+
.. [2] A. T. Young and W. M. Irvine, "Multicolor Photoelectric
186+
Photometry of the Brighter Planets," The Astronomical Journal, vol.
187+
72, pp. 945-950, 1967.
188188
189-
[3] Fritz Kasten and Andrew Young. "Revised optical air mass tables
190-
and approximation formula". Applied Optics 28:4735-4738
189+
.. [3] Fritz Kasten and Andrew Young. "Revised optical air mass tables
190+
and approximation formula". Applied Optics 28:4735-4738
191191
192-
[4] C. Gueymard, "Critical analysis and performance assessment of
193-
clear sky solar irradiance models using theoretical and measured
194-
data," Solar Energy, vol. 51, pp. 121-138, 1993.
192+
.. [4] C. Gueymard, "Critical analysis and performance assessment of
193+
clear sky solar irradiance models using theoretical and measured
194+
data," Solar Energy, vol. 51, pp. 121-138, 1993.
195195
196-
[5] A. T. Young, "AIR-MASS AND REFRACTION," Applied Optics, vol. 33,
197-
pp. 1108-1110, Feb 1994.
196+
.. [5] A. T. Young, "AIR-MASS AND REFRACTION," Applied Optics, vol. 33,
197+
pp. 1108-1110, Feb 1994.
198198
199-
[6] Keith A. Pickering. "The Ancient Star Catalog". DIO 12:1, 20,
199+
.. [6] Keith A. Pickering. "The Ancient Star Catalog". DIO 12:1, 20,
200200
201-
[7] Matthew J. Reno, Clifford W. Hansen and Joshua S. Stein, "Global
202-
Horizontal Irradiance Clear Sky Models: Implementation and Analysis"
203-
Sandia Report, (2012).
201+
.. [7] Matthew J. Reno, Clifford W. Hansen and Joshua S. Stein, "Global
202+
Horizontal Irradiance Clear Sky Models: Implementation and Analysis"
203+
Sandia Report, (2012).
204204
'''
205205

206206
# set zenith values greater than 90 to nans
@@ -518,13 +518,13 @@ def bird_hulstrom80_aod_bb(aod380, aod500):
518518
519519
References
520520
----------
521-
[1] Bird and Hulstrom, "Direct Insolation Models" (1980)
522-
`SERI/TR-335-344 <http://www.nrel.gov/docs/legosti/old/344.pdf>`_
521+
.. [1] Bird and Hulstrom, "Direct Insolation Models" (1980)
522+
`SERI/TR-335-344 <http://www.nrel.gov/docs/legosti/old/344.pdf>`_
523523
524-
[2] R. E. Bird and R. L. Hulstrom, "Review, Evaluation, and Improvement of
525-
Direct Irradiance Models", Journal of Solar Energy Engineering 103(3),
526-
pp. 182-192 (1981)
527-
:doi:`10.1115/1.3266239`
524+
.. [2] R. E. Bird and R. L. Hulstrom, "Review, Evaluation, and Improvement
525+
of Direct Irradiance Models", Journal of Solar Energy Engineering
526+
103(3), pp. 182-192 (1981)
527+
:doi:`10.1115/1.3266239`
528528
"""
529529
# approximate broadband AOD using (Bird-Hulstrom 1980)
530530
return 0.27583 * aod380 + 0.35 * aod500
@@ -565,32 +565,32 @@ def kasten96_lt(airmass_absolute, precipitable_water, aod_bb):
565565
566566
References
567567
----------
568-
[1] F. Linke, "Transmissions-Koeffizient und Trubungsfaktor", Beitrage
569-
zur Physik der Atmosphare, Vol 10, pp. 91-103 (1922)
570-
571-
[2] F. Kasten, "A simple parameterization of the pyrheliometric formula for
572-
determining the Linke turbidity factor", Meteorologische Rundschau 33,
573-
pp. 124-127 (1980)
574-
575-
[3] Kasten, "The Linke turbidity factor based on improved values of the
576-
integral Rayleigh optical thickness", Solar Energy, Vol. 56, No. 3,
577-
pp. 239-244 (1996)
578-
:doi:`10.1016/0038-092X(95)00114-7`
579-
580-
[4] B. Molineaux, P. Ineichen, N. O'Neill, "Equivalence of pyrheliometric
581-
and monochromatic aerosol optical depths at a single key wavelength",
582-
Applied Optics Vol. 37, issue 10, 7008-7018 (1998)
583-
:doi:`10.1364/AO.37.007008`
584-
585-
[5] P. Ineichen, "Conversion function between the Linke turbidity and the
586-
atmospheric water vapor and aerosol content", Solar Energy 82,
587-
pp. 1095-1097 (2008)
588-
:doi:`10.1016/j.solener.2008.04.010`
589-
590-
[6] P. Ineichen and R. Perez, "A new airmass independent formulation for
591-
the Linke Turbidity coefficient", Solar Energy, Vol. 73, no. 3, pp. 151-157
592-
(2002)
593-
:doi:`10.1016/S0038-092X(02)00045-2`
568+
.. [1] F. Linke, "Transmissions-Koeffizient und Trubungsfaktor", Beitrage
569+
zur Physik der Atmosphare, Vol 10, pp. 91-103 (1922)
570+
571+
.. [2] F. Kasten, "A simple parameterization of the pyrheliometric formula
572+
for determining the Linke turbidity factor", Meteorologische Rundschau
573+
33, pp. 124-127 (1980)
574+
575+
.. [3] Kasten, "The Linke turbidity factor based on improved values of the
576+
integral Rayleigh optical thickness", Solar Energy, Vol. 56, No. 3,
577+
pp. 239-244 (1996)
578+
:doi:`10.1016/0038-092X(95)00114-7`
579+
580+
.. [4] B. Molineaux, P. Ineichen, N. O'Neill, "Equivalence of
581+
pyrheliometric and monochromatic aerosol optical depths at a single key
582+
wavelength", Applied Optics Vol. 37, issue 10, 7008-7018 (1998)
583+
:doi:`10.1364/AO.37.007008`
584+
585+
.. [5] P. Ineichen, "Conversion function between the Linke turbidity and
586+
the atmospheric water vapor and aerosol content", Solar Energy 82,
587+
pp. 1095-1097 (2008)
588+
:doi:`10.1016/j.solener.2008.04.010`
589+
590+
.. [6] P. Ineichen and R. Perez, "A new airmass independent formulation for
591+
the Linke Turbidity coefficient", Solar Energy, Vol. 73, no. 3,
592+
pp. 151-157 (2002)
593+
:doi:`10.1016/S0038-092X(02)00045-2`
594594
"""
595595
# "From numerically integrated spectral simulations done with Modtran
596596
# (Berk, 1989), Molineaux (1998) obtained for the broadband optical depth
@@ -644,14 +644,15 @@ def angstrom_aod_at_lambda(aod0, lambda0, alpha=1.14, lambda1=700.0):
644644
645645
References
646646
----------
647-
[1] Anders Angstrom, "On the Atmospheric Transmission of Sun Radiation and
648-
On Dust in the Air", Geografiska Annaler Vol. 11, pp. 156-166 (1929) JSTOR
649-
:doi:`10.2307/519399`
650-
651-
[2] Anders Angstrom, "Techniques of Determining the Turbidity of the
652-
Atmosphere", Tellus 13:2, pp. 214-223 (1961) Taylor & Francis
653-
:doi:`10.3402/tellusa.v13i2.9493` and Co-Action Publishing
654-
:doi:`10.1111/j.2153-3490.1961.tb00078.x`
647+
.. [1] Anders Angstrom, "On the Atmospheric Transmission of Sun Radiation
648+
and On Dust in the Air", Geografiska Annaler Vol. 11, pp. 156-166 (1929)
649+
JSTOR
650+
:doi:`10.2307/519399`
651+
652+
.. [2] Anders Angstrom, "Techniques of Determining the Turbidity of the
653+
Atmosphere", Tellus 13:2, pp. 214-223 (1961) Taylor & Francis
654+
:doi:`10.3402/tellusa.v13i2.9493` and Co-Action Publishing
655+
:doi:`10.1111/j.2153-3490.1961.tb00078.x`
655656
"""
656657
return aod0 * ((lambda1 / lambda0) ** (-alpha))
657658

pvlib/clearsky.py

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,23 @@ def ineichen(apparent_zenith, airmass_absolute, linke_turbidity,
6464
6565
References
6666
----------
67-
[1] P. Ineichen and R. Perez, "A New airmass independent formulation for
68-
the Linke turbidity coefficient", Solar Energy, vol 73, pp. 151-157,
69-
2002.
67+
.. [1] P. Ineichen and R. Perez, "A New airmass independent formulation for
68+
the Linke turbidity coefficient", Solar Energy, vol 73, pp. 151-157,
69+
2002.
7070
71-
[2] R. Perez et. al., "A New Operational Model for Satellite-Derived
72-
Irradiances: Description and Validation", Solar Energy, vol 73, pp.
73-
307-317, 2002.
71+
.. [2] R. Perez et. al., "A New Operational Model for Satellite-Derived
72+
Irradiances: Description and Validation", Solar Energy, vol 73, pp.
73+
307-317, 2002.
7474
75-
[3] M. Reno, C. Hansen, and J. Stein, "Global Horizontal Irradiance Clear
76-
Sky Models: Implementation and Analysis", Sandia National
77-
Laboratories, SAND2012-2389, 2012.
75+
.. [3] M. Reno, C. Hansen, and J. Stein, "Global Horizontal Irradiance
76+
Clear Sky Models: Implementation and Analysis", Sandia National
77+
Laboratories, SAND2012-2389, 2012.
7878
79-
[4] http://www.soda-is.com/eng/services/climat_free_eng.php#c5 (obtained
80-
July 17, 2012).
79+
.. [4] http://www.soda-is.com/eng/services/climat_free_eng.php#c5 (obtained
80+
July 17, 2012).
8181
82-
[5] J. Remund, et. al., "Worldwide Linke Turbidity Information", Proc.
83-
ISES Solar World Congress, June 2003. Goteborg, Sweden.
82+
.. [5] J. Remund, et. al., "Worldwide Linke Turbidity Information", Proc.
83+
ISES Solar World Congress, June 2003. Goteborg, Sweden.
8484
'''
8585

8686
# ghi is calculated using either the equations in [1] by setting
@@ -377,15 +377,15 @@ def haurwitz(apparent_zenith):
377377
References
378378
----------
379379
380-
[1] B. Haurwitz, "Insolation in Relation to Cloudiness and Cloud
381-
Density," Journal of Meteorology, vol. 2, pp. 154-166, 1945.
380+
.. [1] B. Haurwitz, "Insolation in Relation to Cloudiness and Cloud
381+
Density," Journal of Meteorology, vol. 2, pp. 154-166, 1945.
382382
383-
[2] B. Haurwitz, "Insolation in Relation to Cloud Type," Journal of
384-
Meteorology, vol. 3, pp. 123-124, 1946.
383+
.. [2] B. Haurwitz, "Insolation in Relation to Cloud Type," Journal of
384+
Meteorology, vol. 3, pp. 123-124, 1946.
385385
386-
[3] M. Reno, C. Hansen, and J. Stein, "Global Horizontal Irradiance Clear
387-
Sky Models: Implementation and Analysis", Sandia National
388-
Laboratories, SAND2012-2389, 2012.
386+
.. [3] M. Reno, C. Hansen, and J. Stein, "Global Horizontal Irradiance
387+
Clear Sky Models: Implementation and Analysis", Sandia National
388+
Laboratories, SAND2012-2389, 2012.
389389
'''
390390

391391
cos_zenith = tools.cosd(apparent_zenith.values)
@@ -673,9 +673,9 @@ def detect_clearsky(measured, clearsky, times, window_length,
673673
674674
References
675675
----------
676-
[1] Reno, M.J. and C.W. Hansen, "Identification of periods of clear
677-
sky irradiance in time series of GHI measurements" Renewable Energy,
678-
v90, p. 520-531, 2016.
676+
.. [1] Reno, M.J. and C.W. Hansen, "Identification of periods of clear
677+
sky irradiance in time series of GHI measurements" Renewable Energy,
678+
v90, p. 520-531, 2016.
679679
680680
Notes
681681
-----
@@ -853,18 +853,22 @@ def bird(zenith, airmass_relative, aod380, aod500, precipitable_water,
853853
854854
References
855855
----------
856-
[1] R. E. Bird and R. L Hulstrom, "A Simplified Clear Sky model for Direct
857-
and Diffuse Insolation on Horizontal Surfaces" SERI Technical Report
858-
SERI/TR-642-761, Feb 1981. Solar Energy Research Institute, Golden, CO.
856+
.. [1] R. E. Bird and R. L Hulstrom, "A Simplified Clear Sky model for
857+
Direct and Diffuse Insolation on Horizontal Surfaces" SERI Technical
858+
Report SERI/TR-642-761, Feb 1981. Solar Energy Research Institute,
859+
Golden, CO.
859860
860-
[2] Daryl R. Myers, "Solar Radiation: Practical Modeling for Renewable
861-
Energy Applications", pp. 46-51 CRC Press (2013)
861+
.. [2] Daryl R. Myers, "Solar Radiation: Practical Modeling for Renewable
862+
Energy Applications", pp. 46-51 CRC Press (2013)
862863
863-
`NREL Bird Clear Sky Model <http://rredc.nrel.gov/solar/models/clearsky/>`_
864+
.. [3] `NREL Bird Clear Sky Model <http://rredc.nrel.gov/solar/models/
865+
clearsky/>`_
864866
865-
`SERI/TR-642-761 <http://rredc.nrel.gov/solar/pubs/pdfs/tr-642-761.pdf>`_
867+
.. [4] `SERI/TR-642-761 <http://rredc.nrel.gov/solar/pubs/pdfs/
868+
tr-642-761.pdf>`_
866869
867-
`Error Reports <http://rredc.nrel.gov/solar/models/clearsky/error_reports.html>`_
870+
.. [5] `Error Reports <http://rredc.nrel.gov/solar/models/clearsky/
871+
error_reports.html>`_
868872
"""
869873
etr = dni_extra # extraradiation
870874
ze_rad = np.deg2rad(zenith) # zenith in radians

0 commit comments

Comments
 (0)