Skip to content

Docstring formatting #833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 37 commits into from
Dec 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c7ea688
improve docstring sphinx rendering in ModelChain methods
kevinsa5 Dec 10, 2019
bc09814
improve docstring sphinx rendering in Location.from_tmy
kevinsa5 Dec 10, 2019
4cb0b0d
improve docstring sphinx rendering in tracking.singleaxis
kevinsa5 Dec 10, 2019
106ab87
improve docstring sphinx rendering in iotools.midc.read_midc
kevinsa5 Dec 10, 2019
9520610
improve docstring sphinx rendering in ivtools functions
kevinsa5 Dec 10, 2019
af11331
remove duplicate pvwatts_losses entry in api.rst
kevinsa5 Dec 10, 2019
0ae798e
improve docstring sphinx rendering in clearsky functions
kevinsa5 Dec 10, 2019
dd3c614
add whatsnew entry
kevinsa5 Dec 11, 2019
13a699b
update formatting of "Assigns attributes" info in modelchain.py docst…
kevinsa5 Dec 11, 2019
5bbf06c
fix capitalization in iotools.midc.read_midc
kevinsa5 Dec 11, 2019
a928c41
improve docstring formatting for return value dict keys in ivtools.fi…
kevinsa5 Dec 11, 2019
864e517
simplify Location.from_tmy docstring
kevinsa5 Dec 12, 2019
dfef019
pin sphinx version at 1.8.5 in setup.py
kevinsa5 Dec 13, 2019
a15484f
make solarposition.py footnotes compatible with numpydoc
kevinsa5 Dec 13, 2019
4257f97
make clearsky.py footnotes compatible with numpydoc
kevinsa5 Dec 13, 2019
f62a376
make atmosphere.py footnotes compatible with numpydoc
kevinsa5 Dec 13, 2019
ec5dfc5
make irradiance.py footnotes compatible with numpydoc
kevinsa5 Dec 13, 2019
336fb47
make iam.py footnotes compatible with numpydoc
kevinsa5 Dec 13, 2019
f6d683f
make temperature.py footnotes compatible with numpydoc
kevinsa5 Dec 13, 2019
81103ad
make pvsystem.py footnotes compatible with numpydoc
kevinsa5 Dec 13, 2019
9a38a02
make singlediode.py footnotes compatible with numpydoc
kevinsa5 Dec 13, 2019
ba530f7
make ivtools.py footnotes compatible with numpydoc
kevinsa5 Dec 13, 2019
27292af
make tracking.py footnotes compatible with numpydoc
kevinsa5 Dec 13, 2019
a6f6c2b
make tmy.py footnotes compatible with numpydoc
kevinsa5 Dec 13, 2019
1eb5122
make epw.py footnotes compatible with numpydoc
kevinsa5 Dec 13, 2019
bdab55c
make srml.py footnotes compatible with numpydoc
kevinsa5 Dec 13, 2019
e1f6168
make surfrad.py footnotes compatible with numpydoc
kevinsa5 Dec 13, 2019
37ba6c1
make psm3.py footnotes compatible with numpydoc
kevinsa5 Dec 13, 2019
9309522
fix typo in pvsyst_cell docstring footnote
kevinsa5 Dec 13, 2019
d62e7c4
add sphinx suppress_warnings entry for unreferenced footnote warnings
kevinsa5 Dec 13, 2019
0962a4e
make the stickler happy
kevinsa5 Dec 13, 2019
57a8098
fix improper reference format in pvsystem.calcparams_pvsyst docstring
kevinsa5 Dec 13, 2019
0c20996
remove TMY module from api.rst and add pvsystem.adrinverter
kevinsa5 Dec 14, 2019
6c9203c
add link to github issue about suppressing sphinx warnings
kevinsa5 Dec 14, 2019
5700205
Merge branch 'master' into docstring_formatting
kevinsa5 Dec 14, 2019
de881cc
fix lint issue in pvsystem.py and make pvsystem.adrinverter docstring…
kevinsa5 Dec 16, 2019
6c2cf74
Merge branch 'docstring_formatting' of https://github.com/kevinsa5/pv…
kevinsa5 Dec 16, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions docs/sphinx/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ Functions relevant for the SAPM model.
pvsystem.sapm_spectral_loss
pvsystem.sapm_aoi_loss
pvsystem.snlinverter
pvsystem.adrinverter
temperature.sapm_cell

Pvsyst model
Expand All @@ -296,7 +297,6 @@ PVWatts model
pvsystem.pvwatts_dc
pvsystem.pvwatts_ac
pvsystem.pvwatts_losses
pvsystem.pvwatts_losses

Functions for fitting PV models
-------------------------------
Expand Down Expand Up @@ -380,24 +380,6 @@ in some files.
location.Location.from_epw


TMY
===

.. warning::

The :py:mod:`pvlib.tmy` module is deprecated; it will be removed
in pvlib 0.7. Please see the :ref:`pvlib.iotools <iotools>` package.

Methods and functions for reading data from TMY files.

.. autosummary::
:toctree: generated/

location.Location.from_tmy
tmy.readtmy2
tmy.readtmy3


Forecasting
===========

Expand Down
4 changes: 4 additions & 0 deletions docs/sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,3 +320,7 @@ def setup(app):
nbsphinx_allow_errors = True

ipython_warning_is_error = False

# suppress "WARNING: Footnote [1] is not referenced." messages
# https://github.com/pvlib/pvlib-python/issues/837
suppress_warnings = ['ref.footnote']
6 changes: 6 additions & 0 deletions docs/sphinx/source/whatsnew/v0.7.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ Documentation
used. (:issue:`785`)
* Note warning about _TMY3.epw files retrieved from energyplus.net in docstring
of `epw.read_epw`
* Improved sphinx rendering of API reference entries for `clearsky.ineichen`,
`clearsky.haurwitz`, `tracking.singleaxis`, `iotools.read_midc`,
`Location.from_tmy`, `ModelChain.run_model`, `ModelChain.complete_irradiance`,
and `ModelChain.prepare_inputs`
* Removed duplicate `pvwatts_losses` entry in `api.rst`

Removal of prior version deprecations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -212,3 +217,4 @@ Contributors
* Tony Lorenzo (:ghuser:`alorenzo175`)
* Todd Karin (:ghuser:`toddkarin`)
* Mark Mikofski (:ghuser:`mikofski`)
* Kevin Anderson (:ghuser:`kevinsa5`)
129 changes: 65 additions & 64 deletions pvlib/atmosphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def pres2alt(pressure):

References
-----------
[1] "A Quick Derivation relating altitude to air pressure" from
Portland State Aerospace Society, Version 1.03, 12/22/2004.
.. [1] "A Quick Derivation relating altitude to air pressure" from
Portland State Aerospace Society, Version 1.03, 12/22/2004.
'''

alt = 44331.5 - 4946.62 * pressure ** (0.190263)
Expand Down Expand Up @@ -86,8 +86,8 @@ def alt2pres(altitude):

References
-----------
[1] "A Quick Derivation relating altitude to air pressure" from
Portland State Aerospace Society, Version 1.03, 12/22/2004.
.. [1] "A Quick Derivation relating altitude to air pressure" from
Portland State Aerospace Society, Version 1.03, 12/22/2004.
'''

press = 100 * ((44331.514 - altitude) / 11880.516) ** (1 / 0.1902632)
Expand Down Expand Up @@ -124,9 +124,9 @@ def get_absolute_airmass(airmass_relative, pressure=101325.):

References
----------
[1] C. Gueymard, "Critical analysis and performance assessment of
clear sky solar irradiance models using theoretical and measured
data," Solar Energy, vol. 51, pp. 121-138, 1993.
.. [1] C. Gueymard, "Critical analysis and performance assessment of
clear sky solar irradiance models using theoretical and measured
data," Solar Energy, vol. 51, pp. 121-138, 1993.
'''

airmass_absolute = airmass_relative * pressure / 101325.
Expand Down Expand Up @@ -178,29 +178,29 @@ def get_relative_airmass(zenith, model='kastenyoung1989'):

References
----------
[1] Fritz Kasten. "A New Table and Approximation Formula for the
Relative Optical Air Mass". Technical Report 136, Hanover, N.H.:
U.S. Army Material Command, CRREL.
.. [1] Fritz Kasten. "A New Table and Approximation Formula for the
Relative Optical Air Mass". Technical Report 136, Hanover, N.H.:
U.S. Army Material Command, CRREL.

[2] A. T. Young and W. M. Irvine, "Multicolor Photoelectric
Photometry of the Brighter Planets," The Astronomical Journal, vol.
72, pp. 945-950, 1967.
.. [2] A. T. Young and W. M. Irvine, "Multicolor Photoelectric
Photometry of the Brighter Planets," The Astronomical Journal, vol.
72, pp. 945-950, 1967.

[3] Fritz Kasten and Andrew Young. "Revised optical air mass tables
and approximation formula". Applied Optics 28:4735-4738
.. [3] Fritz Kasten and Andrew Young. "Revised optical air mass tables
and approximation formula". Applied Optics 28:4735-4738

[4] C. Gueymard, "Critical analysis and performance assessment of
clear sky solar irradiance models using theoretical and measured
data," Solar Energy, vol. 51, pp. 121-138, 1993.
.. [4] C. Gueymard, "Critical analysis and performance assessment of
clear sky solar irradiance models using theoretical and measured
data," Solar Energy, vol. 51, pp. 121-138, 1993.

[5] A. T. Young, "AIR-MASS AND REFRACTION," Applied Optics, vol. 33,
pp. 1108-1110, Feb 1994.
.. [5] A. T. Young, "AIR-MASS AND REFRACTION," Applied Optics, vol. 33,
pp. 1108-1110, Feb 1994.

[6] Keith A. Pickering. "The Ancient Star Catalog". DIO 12:1, 20,
.. [6] Keith A. Pickering. "The Ancient Star Catalog". DIO 12:1, 20,

[7] Matthew J. Reno, Clifford W. Hansen and Joshua S. Stein, "Global
Horizontal Irradiance Clear Sky Models: Implementation and Analysis"
Sandia Report, (2012).
.. [7] Matthew J. Reno, Clifford W. Hansen and Joshua S. Stein, "Global
Horizontal Irradiance Clear Sky Models: Implementation and Analysis"
Sandia Report, (2012).
'''

# set zenith values greater than 90 to nans
Expand Down Expand Up @@ -518,13 +518,13 @@ def bird_hulstrom80_aod_bb(aod380, aod500):

References
----------
[1] Bird and Hulstrom, "Direct Insolation Models" (1980)
`SERI/TR-335-344 <http://www.nrel.gov/docs/legosti/old/344.pdf>`_
.. [1] Bird and Hulstrom, "Direct Insolation Models" (1980)
`SERI/TR-335-344 <http://www.nrel.gov/docs/legosti/old/344.pdf>`_

[2] R. E. Bird and R. L. Hulstrom, "Review, Evaluation, and Improvement of
Direct Irradiance Models", Journal of Solar Energy Engineering 103(3),
pp. 182-192 (1981)
:doi:`10.1115/1.3266239`
.. [2] R. E. Bird and R. L. Hulstrom, "Review, Evaluation, and Improvement
of Direct Irradiance Models", Journal of Solar Energy Engineering
103(3), pp. 182-192 (1981)
:doi:`10.1115/1.3266239`
"""
# approximate broadband AOD using (Bird-Hulstrom 1980)
return 0.27583 * aod380 + 0.35 * aod500
Expand Down Expand Up @@ -565,32 +565,32 @@ def kasten96_lt(airmass_absolute, precipitable_water, aod_bb):

References
----------
[1] F. Linke, "Transmissions-Koeffizient und Trubungsfaktor", Beitrage
zur Physik der Atmosphare, Vol 10, pp. 91-103 (1922)

[2] F. Kasten, "A simple parameterization of the pyrheliometric formula for
determining the Linke turbidity factor", Meteorologische Rundschau 33,
pp. 124-127 (1980)

[3] Kasten, "The Linke turbidity factor based on improved values of the
integral Rayleigh optical thickness", Solar Energy, Vol. 56, No. 3,
pp. 239-244 (1996)
:doi:`10.1016/0038-092X(95)00114-7`

[4] B. Molineaux, P. Ineichen, N. O'Neill, "Equivalence of pyrheliometric
and monochromatic aerosol optical depths at a single key wavelength",
Applied Optics Vol. 37, issue 10, 7008-7018 (1998)
:doi:`10.1364/AO.37.007008`

[5] P. Ineichen, "Conversion function between the Linke turbidity and the
atmospheric water vapor and aerosol content", Solar Energy 82,
pp. 1095-1097 (2008)
:doi:`10.1016/j.solener.2008.04.010`

[6] P. Ineichen and R. Perez, "A new airmass independent formulation for
the Linke Turbidity coefficient", Solar Energy, Vol. 73, no. 3, pp. 151-157
(2002)
:doi:`10.1016/S0038-092X(02)00045-2`
.. [1] F. Linke, "Transmissions-Koeffizient und Trubungsfaktor", Beitrage
zur Physik der Atmosphare, Vol 10, pp. 91-103 (1922)

.. [2] F. Kasten, "A simple parameterization of the pyrheliometric formula
for determining the Linke turbidity factor", Meteorologische Rundschau
33, pp. 124-127 (1980)

.. [3] Kasten, "The Linke turbidity factor based on improved values of the
integral Rayleigh optical thickness", Solar Energy, Vol. 56, No. 3,
pp. 239-244 (1996)
:doi:`10.1016/0038-092X(95)00114-7`

.. [4] B. Molineaux, P. Ineichen, N. O'Neill, "Equivalence of
pyrheliometric and monochromatic aerosol optical depths at a single key
wavelength", Applied Optics Vol. 37, issue 10, 7008-7018 (1998)
:doi:`10.1364/AO.37.007008`

.. [5] P. Ineichen, "Conversion function between the Linke turbidity and
the atmospheric water vapor and aerosol content", Solar Energy 82,
pp. 1095-1097 (2008)
:doi:`10.1016/j.solener.2008.04.010`

.. [6] P. Ineichen and R. Perez, "A new airmass independent formulation for
the Linke Turbidity coefficient", Solar Energy, Vol. 73, no. 3,
pp. 151-157 (2002)
:doi:`10.1016/S0038-092X(02)00045-2`
"""
# "From numerically integrated spectral simulations done with Modtran
# (Berk, 1989), Molineaux (1998) obtained for the broadband optical depth
Expand Down Expand Up @@ -644,14 +644,15 @@ def angstrom_aod_at_lambda(aod0, lambda0, alpha=1.14, lambda1=700.0):

References
----------
[1] Anders Angstrom, "On the Atmospheric Transmission of Sun Radiation and
On Dust in the Air", Geografiska Annaler Vol. 11, pp. 156-166 (1929) JSTOR
:doi:`10.2307/519399`

[2] Anders Angstrom, "Techniques of Determining the Turbidity of the
Atmosphere", Tellus 13:2, pp. 214-223 (1961) Taylor & Francis
:doi:`10.3402/tellusa.v13i2.9493` and Co-Action Publishing
:doi:`10.1111/j.2153-3490.1961.tb00078.x`
.. [1] Anders Angstrom, "On the Atmospheric Transmission of Sun Radiation
and On Dust in the Air", Geografiska Annaler Vol. 11, pp. 156-166 (1929)
JSTOR
:doi:`10.2307/519399`

.. [2] Anders Angstrom, "Techniques of Determining the Turbidity of the
Atmosphere", Tellus 13:2, pp. 214-223 (1961) Taylor & Francis
:doi:`10.3402/tellusa.v13i2.9493` and Co-Action Publishing
:doi:`10.1111/j.2153-3490.1961.tb00078.x`
"""
return aod0 * ((lambda1 / lambda0) ** (-alpha))

Expand Down
66 changes: 35 additions & 31 deletions pvlib/clearsky.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,23 @@ def ineichen(apparent_zenith, airmass_absolute, linke_turbidity,

References
----------
[1] P. Ineichen and R. Perez, "A New airmass independent formulation for
the Linke turbidity coefficient", Solar Energy, vol 73, pp. 151-157,
2002.
.. [1] P. Ineichen and R. Perez, "A New airmass independent formulation for
the Linke turbidity coefficient", Solar Energy, vol 73, pp. 151-157,
2002.

[2] R. Perez et. al., "A New Operational Model for Satellite-Derived
Irradiances: Description and Validation", Solar Energy, vol 73, pp.
307-317, 2002.
.. [2] R. Perez et. al., "A New Operational Model for Satellite-Derived
Irradiances: Description and Validation", Solar Energy, vol 73, pp.
307-317, 2002.

[3] M. Reno, C. Hansen, and J. Stein, "Global Horizontal Irradiance Clear
Sky Models: Implementation and Analysis", Sandia National
Laboratories, SAND2012-2389, 2012.
.. [3] M. Reno, C. Hansen, and J. Stein, "Global Horizontal Irradiance
Clear Sky Models: Implementation and Analysis", Sandia National
Laboratories, SAND2012-2389, 2012.

[4] http://www.soda-is.com/eng/services/climat_free_eng.php#c5 (obtained
July 17, 2012).
.. [4] http://www.soda-is.com/eng/services/climat_free_eng.php#c5 (obtained
July 17, 2012).

[5] J. Remund, et. al., "Worldwide Linke Turbidity Information", Proc.
ISES Solar World Congress, June 2003. Goteborg, Sweden.
.. [5] J. Remund, et. al., "Worldwide Linke Turbidity Information", Proc.
ISES Solar World Congress, June 2003. Goteborg, Sweden.
'''

# ghi is calculated using either the equations in [1] by setting
Expand Down Expand Up @@ -377,15 +377,15 @@ def haurwitz(apparent_zenith):
References
----------

[1] B. Haurwitz, "Insolation in Relation to Cloudiness and Cloud
Density," Journal of Meteorology, vol. 2, pp. 154-166, 1945.
.. [1] B. Haurwitz, "Insolation in Relation to Cloudiness and Cloud
Density," Journal of Meteorology, vol. 2, pp. 154-166, 1945.

[2] B. Haurwitz, "Insolation in Relation to Cloud Type," Journal of
Meteorology, vol. 3, pp. 123-124, 1946.
.. [2] B. Haurwitz, "Insolation in Relation to Cloud Type," Journal of
Meteorology, vol. 3, pp. 123-124, 1946.

[3] M. Reno, C. Hansen, and J. Stein, "Global Horizontal Irradiance Clear
Sky Models: Implementation and Analysis", Sandia National
Laboratories, SAND2012-2389, 2012.
.. [3] M. Reno, C. Hansen, and J. Stein, "Global Horizontal Irradiance
Clear Sky Models: Implementation and Analysis", Sandia National
Laboratories, SAND2012-2389, 2012.
'''

cos_zenith = tools.cosd(apparent_zenith.values)
Expand Down Expand Up @@ -673,9 +673,9 @@ def detect_clearsky(measured, clearsky, times, window_length,

References
----------
[1] Reno, M.J. and C.W. Hansen, "Identification of periods of clear
sky irradiance in time series of GHI measurements" Renewable Energy,
v90, p. 520-531, 2016.
.. [1] Reno, M.J. and C.W. Hansen, "Identification of periods of clear
sky irradiance in time series of GHI measurements" Renewable Energy,
v90, p. 520-531, 2016.

Notes
-----
Expand Down Expand Up @@ -853,18 +853,22 @@ def bird(zenith, airmass_relative, aod380, aod500, precipitable_water,

References
----------
[1] R. E. Bird and R. L Hulstrom, "A Simplified Clear Sky model for Direct
and Diffuse Insolation on Horizontal Surfaces" SERI Technical Report
SERI/TR-642-761, Feb 1981. Solar Energy Research Institute, Golden, CO.
.. [1] R. E. Bird and R. L Hulstrom, "A Simplified Clear Sky model for
Direct and Diffuse Insolation on Horizontal Surfaces" SERI Technical
Report SERI/TR-642-761, Feb 1981. Solar Energy Research Institute,
Golden, CO.

[2] Daryl R. Myers, "Solar Radiation: Practical Modeling for Renewable
Energy Applications", pp. 46-51 CRC Press (2013)
.. [2] Daryl R. Myers, "Solar Radiation: Practical Modeling for Renewable
Energy Applications", pp. 46-51 CRC Press (2013)

`NREL Bird Clear Sky Model <http://rredc.nrel.gov/solar/models/clearsky/>`_
.. [3] `NREL Bird Clear Sky Model <http://rredc.nrel.gov/solar/models/
clearsky/>`_

`SERI/TR-642-761 <http://rredc.nrel.gov/solar/pubs/pdfs/tr-642-761.pdf>`_
.. [4] `SERI/TR-642-761 <http://rredc.nrel.gov/solar/pubs/pdfs/
tr-642-761.pdf>`_

`Error Reports <http://rredc.nrel.gov/solar/models/clearsky/error_reports.html>`_
.. [5] `Error Reports <http://rredc.nrel.gov/solar/models/clearsky/
error_reports.html>`_
"""
etr = dni_extra # extraradiation
ze_rad = np.deg2rad(zenith) # zenith in radians
Expand Down
Loading