8000 DOC: fix napoleon, render sphinx docs right by mikofski · Pull Request #691 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

DOC: fix napoleon, render sphinx docs right #691

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
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ dependencies:
- ephem
- numba
- ipython=6.3
- numpydoc
- matplotlib=2.2.2
- siphon=0.7.0
- sphinx=1.7.2
Expand Down
7 changes: 4 additions & 3 deletions docs/sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ def __getattr__(cls, name):

# -- General configuration ------------------------------------------------

# turns off numpydoc autosummary warnings
numpydoc_show_class_members = False
# use napoleon in lieu of numpydoc 2019-04-23

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
Expand All @@ -55,12 +54,14 @@ def __getattr__(cls, name):
'sphinx.ext.viewcode',
'sphinx.ext.intersphinx',
'sphinx.ext.extlinks',
'numpydoc',
'sphinx.ext.napoleon',
'sphinx.ext.autosummary',
'IPython.sphinxext.ipython_directive',
'IPython.sphinxext.ipython_console_highlighting'
]

napoleon_use_rtype = False # group rtype on same line together with return

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down
4 changes: 3 additions & 1 deletion docs/sphinx/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,9 @@ Documentation
~~~~~~~~~~~~~

Documentation must be written in
`numpydoc format <https://numpydoc.readthedocs.io/>`_.
`numpydoc format <https://numpydoc.readthedocs.io/>`_ format which is rendered
using the `Sphinx Napoleon extension
<https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html>`_.

The numpydoc format includes a specification for the allowable input
types. Python's `duck typing <https://en.wikipedia.org/wiki/Duck_typing>`_
Expand Down
4 changes: 2 additions & 2 deletions pvlib/bifacial.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def pvfactors_timeseries(
Please refer to pvfactors online documentation for more details:
https://sunpower.github.io/pvfactors/

Inputs
------
Parameters
----------
solar_azimuth: numeric
Sun's azimuth angles using pvlib's azimuth convention (deg)
solar_zenith: numeric
Expand Down
8 changes: 5 additions & 3 deletions pvlib/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ def get_solarposition(self, times, pressure=None, temperature=12,
:py:func:`atmosphere.alt2pres` and ``self.altitude``.
temperature : None, float, or array-like, default 12

kwargs passed to :py:func:`solarposition.get_solarposition`
kwargs
passed to :py:func:`solarposition.get_solarposition`

Returns
-------
Expand Down Expand Up @@ -178,8 +179,9 @@ def get_clearsky(self, times, model='ineichen', solar_position=None,
dni_extra: None or numeric, default None
If None, will be calculated from times.

kwargs passed to the relevant functions. Climatological values
are assumed in many cases. See source code for details!
kwargs
Extra parameters passed to the relevant functions. Climatological
values are assumed in many cases. See source code for details!

Returns
-------
Expand Down
20 changes: 9 additions & 11 deletions pvlib/modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,21 +798,19 @@ def prepare_inputs(self, times=None, weather=None):
Times at which to evaluate the model. Can be None if
attribute `times` is already set.
weather : None or DataFrame, default None
If None, the weather attribute is used. If the weather
attribute is also None assumes air temperature is 20 C, wind
If ``None``, the weather attribute is used. If the weather
attribute is also ``None`` assumes air temperature is 20 C, wind
speed is 0 m/s and irradiation calculated from clear sky
data. Column names must be 'wind_speed', 'temp_air', 'dni',
'ghi', 'dhi'. Do not pass incomplete irradiation data. Use
method
data. Column names must be ``'wind_speed'``, ``'temp_air'``,
``'dni'``, ``'ghi'``, ``'dhi'``. Do not pass incomplete irradiation
data. Use method
:py:meth:`~pvlib.modelchain.ModelChain.complete_irradiance`
instead.

Returns
-------
self

Assigns attributes: times, solar_position, airmass, total_irrad,
aoi
Notes
-----
Assigns attributes: ``times``, ``solar_position``, ``airmass``,
``total_irrad``, `aoi`
"""
if weather is not None:
self.weather = weather
Expand Down
6 changes: 3 additions & 3 deletions pvlib/pvsystem.py
1E0A
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ def get_irradiance(self, solar_zenith, solar_azimuth, dni, ghi, dhi,
model : String, default 'haydavies'
Irradiance model.

**kwargs
Passed to :func:`irradiance.total_irrad`.
kwargs
Extra parameters passed to :func:`irradiance.total_irrad`.

Returns
-------
Expand Down Expand Up @@ -429,7 +429,7 @@ def sapm(self, effective_irradiance, temp_cell, **kwargs):
aoi : Series
Angle of incidence (degrees).

**kwargs
kwargs
See pvsystem.sapm for details

Returns
Expand Down
7 changes: 5 additions & 2 deletions pvlib/solarposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,8 @@ def solar_zenith_analytical(latitude, hourangle, declination):

Returns
-------
zenith : numeric Solar zenith angle in radians.
zenith : numeric
Solar zenith angle in radians.

References
----------
Expand All @@ -1299,7 +1300,9 @@ def solar_zenith_analytical(latitude, hourangle, declination):

See Also
--------
declination_spencer71 declination_cooper69 hour_angle
declination_spencer71
declination_cooper69
hour_angle
"""
return np.arccos(
np.cos(declination) * np.cos(latitude) * np.cos(hourangle) +
Expand Down
20 changes: 20 additions & 0 deletions pvlib/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class SingleAxisTracker(PVSystem):
"""
Inherits the PV modeling methods from :py:class:`~pvlib.pvsystem.PVSystem`.


Parameters
----------
axis_tilt : float, default 0
The tilt of the axis of rotation (i.e, the y-axis defined by
axis_azimuth) with respect to horizontal, in decimal degrees.
Expand Down Expand Up @@ -40,6 +43,7 @@ class SingleAxisTracker(PVSystem):
2 meters wide, centered on the tracking axis, with 6 meters
between the tracking axes has a gcr of 2/6=0.333. If gcr is not
provided, a gcr of 2/7 is default. gcr must be <=1.

"""

def __init__(self, axis_tilt=0, axis_azimuth=0,
Expand Down Expand Up @@ -67,6 +71,22 @@ def __repr__(self):
return sat_repr + '\n' + pvsystem_repr

def singleaxis(self, apparent_zenith, apparent_azimuth):
"""
Get tracking data. See :py:func:`pvlib.tracking.singleaxis` more
detail.

Parameters
----------
apparent_zenith : float, 1d array, or Series
Solar apparent zenith angles in decimal degrees.

apparent_azimuth : float, 1d array, or Series
Solar apparent azimuth angles in decimal degrees.

Returns
-------
tracking data
"""
tracking_data = singleaxis(apparent_zenith, apparent_azimuth,
self.axis_tilt, self.axis_azimuth,
self.max_angle,
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
EXTRAS_REQUIRE = {
'optional': ['scipy', 'tables', 'numba', 'siphon', 'netcdf4',
'ephem', 'cython', 'pvfactors'],
'doc': ['sphinx', 'ipython', 'sphinx_rtd_theme', 'numpydoc',
'matplotlib'],
'doc': ['sphinx', 'ipython', 'sphinx_rtd_theme', 'matplotlib'],
'test': TESTS_REQUIRE
}
EXTRAS_REQUIRE['all'] = sorted(set(sum(EXTRAS_REQUIRE.values(), [])))
Expand Down
0