From f746de1bc95e70f0b5c8e9aaa82ff084432c558e Mon Sep 17 00:00:00 2001 From: Veronica Guo Date: Sun, 4 Oct 2020 23:49:21 -0400 Subject: [PATCH 1/7] Recursive class methods --- docs/sphinx/source/_templates/autosummary/class.rst | 4 ++-- pvlib/pvsystem.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/sphinx/source/_templates/autosummary/class.rst b/docs/sphinx/source/_templates/autosummary/class.rst index e41226a8ac..847f14f8e4 100644 --- a/docs/sphinx/source/_templates/autosummary/class.rst +++ b/docs/sphinx/source/_templates/autosummary/class.rst @@ -5,12 +5,12 @@ .. autoclass:: {{ objname }} {% block methods %} - .. automethod:: __init__ - {% if methods %} .. rubric:: Methods .. autosummary:: + :toctree: + :recursive: {% for item in methods %} ~{{ name }}.{{ item }} {%- endfor %} diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index fecc93075e..25ca371460 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -616,11 +616,11 @@ def first_solar_spectral_loss(self, pw, airmass_absolute): calculate the spectral loss modifier. The model coefficients are specific to the module's cell type, and are determined by searching for one of the following keys in self.module_parameters (in order): - 'first_solar_spectral_coefficients' (user-supplied coefficients) - 'Technology' - a string describing the cell type, can be read from - the CEC module parameter database - 'Material' - a string describing the cell type, can be read from - the Sandia module database. + 'first_solar_spectral_coefficients' (user-supplied coefficients) + 'Technology' - a string describing the cell type, can be read from + the CEC module parameter database + 'Material' - a string describing the cell type, can be read from + the Sandia module database. Parameters ---------- From ae564c853b54f6b919445622ddd2b32495e007b3 Mon Sep 17 00:00:00 2001 From: Veronica Guo Date: Mon, 5 Oct 2020 20:33:15 -0400 Subject: [PATCH 2/7] Clean up docstring --- pvlib/pvsystem.py | 24 ------------------------ pvlib/tracking.py | 4 ++-- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index 25ca371460..dc8776d551 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -701,12 +701,6 @@ def singlediode(self, photocurrent, saturation_current, ivcurve_pnts=None): """Wrapper around the :py:func:`pvlib.pvsystem.singlediode` function. - Parameters - ---------- - See :py:func:`pvsystem.singlediode` for details - - Returns - ------- See :py:func:`pvsystem.singlediode` for details """ return singlediode(photocurrent, saturation_current, @@ -717,12 +711,6 @@ def i_from_v(self, resistance_shunt, resistance_series, nNsVth, voltage, saturation_current, photocurrent): """Wrapper around the :py:func:`pvlib.pvsystem.i_from_v` function. - Parameters - ---------- - See :py:func:`pvsystem.i_from_v` for details - - Returns - ------- See :py:func:`pvsystem.i_from_v` for details """ return i_from_v(resistance_shunt, resistance_series, nNsVth, voltage, @@ -733,12 +721,6 @@ def snlinverter(self, v_dc, p_dc): """Uses :py:func:`pvlib.inverter.sandia` to calculate AC power based on ``self.inverter_parameters`` and the input voltage and power. - Parameters - ---------- - See :py:func:`pvlib.inverter.sandia` for details - - Returns - ------- See :py:func:`pvlib.inverter.sandia` for details """ return inverter.sandia(v_dc, p_dc, self.inverter_parameters) @@ -747,12 +729,6 @@ def adrinverter(self, v_dc, p_dc): """Uses :py:func:`pvlib.inverter.adr` to calculate AC power based on ``self.inverter_parameters`` and the input voltage and power. - Parameters - ---------- - See :py:func:`pvlib.inverter.adr` for details - - Returns - ------- See :py:func:`pvlib.inverter.adr` for details """ return inverter.adr(v_dc, p_dc, self.inverter_parameters) diff --git a/pvlib/tracking.py b/pvlib/tracking.py index 5397055935..73bc79ceb4 100644 --- a/pvlib/tracking.py +++ b/pvlib/tracking.py @@ -149,8 +149,8 @@ def get_aoi(self, surface_tilt, surface_azimuth, solar_zenith, For a given set of solar zenith and azimuth angles, the surface tilt and azimuth parameters are typically determined - by :py:method:`~SingleAxisTracker.singleaxis`. The - :py:method:`~SingleAxisTracker.singleaxis` method also returns + by :py:meth:`~SingleAxisTracker.singleaxis`. The + :py:meth:`~SingleAxisTracker.singleaxis` method also returns the angle of incidence, so this method is only needed if using a different tracking algorithm. From 2f26f541ccd4bb267b60fdf8c8ace9cd21f1ec5f Mon Sep 17 00:00:00 2001 From: Veronica Guo Date: Mon, 5 Oct 2020 21:33:10 -0400 Subject: [PATCH 3/7] Bump sphinx version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 11b8b79df1..498d2739f8 100755 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ 'optional': ['cython', 'ephem', 'netcdf4', 'nrel-pysam', 'numba', 'pvfactors', 'siphon', 'statsmodels', 'tables', 'cftime >= 1.1.1'], - 'doc': ['ipython', 'matplotlib', 'sphinx == 1.8.5', 'sphinx_rtd_theme', + 'doc': ['ipython', 'matplotlib', 'sphinx >= 3.1.2', 'sphinx_rtd_theme', 'sphinx-gallery', 'docutils == 0.15.2', 'pillow', 'netcdf4', 'siphon', 'tables'], 'test': TESTS_REQUIRE From 5e85125b4387a65fefe91d68913dd391b80f9eab Mon Sep 17 00:00:00 2001 From: Veronica Guo Date: Mon, 5 Oct 2020 21:34:25 -0400 Subject: [PATCH 4/7] Update what's new --- docs/sphinx/source/whatsnew/v0.8.1.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.8.1.rst b/docs/sphinx/source/whatsnew/v0.8.1.rst index 50e01401f5..82505fb619 100644 --- a/docs/sphinx/source/whatsnew/v0.8.1.rst +++ b/docs/sphinx/source/whatsnew/v0.8.1.rst @@ -26,7 +26,8 @@ Testing Documentation ~~~~~~~~~~~~~ - +* Update sphinx to 3.1.2 and use the ``recursive`` option in ``autosummary`` class template. + (:issue:`1055`, :pull:`1075`) Requirements ~~~~~~~~~~~~ @@ -35,3 +36,4 @@ Requirements Contributors ~~~~~~~~~~~~ * Kevin Anderson (:ghuser:`kanderso-nrel`) +* Siyan (Veronica) Guo (:ghuser:`veronicaguo`) From 4978d68b3b7aa33b7efae15d66a3867dcf027718 Mon Sep 17 00:00:00 2001 From: Veronica Guo Date: Tue, 13 Oct 2020 17:51:53 -0400 Subject: [PATCH 5/7] Add brackets to reference numbers --- docs/sphinx/source/_static/bracketed_reference_number.css | 6 ++++++ docs/sphinx/source/conf.py | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 docs/sphinx/source/_static/bracketed_reference_number.css diff --git a/docs/sphinx/source/_static/bracketed_reference_number.css b/docs/sphinx/source/_static/bracketed_reference_number.css new file mode 100644 index 0000000000..fa187734b6 --- /dev/null +++ b/docs/sphinx/source/_static/bracketed_reference_number.css @@ -0,0 +1,6 @@ +.footnote-reference::before { + content: '['; +} +.footnote-reference::after { + content: ']'; +} \ No newline at end of file diff --git a/docs/sphinx/source/conf.py b/docs/sphinx/source/conf.py index 7f89f0be3c..6728b47169 100644 --- a/docs/sphinx/source/conf.py +++ b/docs/sphinx/source/conf.py @@ -221,6 +221,8 @@ def setup(app): app.add_stylesheet("no_scrollbars.css") # Override footnote callout CSS to be normal text instead of superscript app.add_stylesheet("no_reference_superscript.css") + # In-line links to references as numbers in brackets. + app.add_stylesheet("bracketed_reference_number.css") # -- Options for LaTeX output --------------------------------------------- From 031fdf7d2bc4c6e7abccb24d919b07d77db72425 Mon Sep 17 00:00:00 2001 From: Veronica Guo Date: Wed, 14 Oct 2020 22:23:31 -0400 Subject: [PATCH 6/7] Fix bulleted list in docstring. Pin sphinx and rtd_theme versions. --- .../source/_static/bracketed_reference_number.css | 6 ------ .../source/_static/no_reference_superscript.css | 4 ---- docs/sphinx/source/_static/reference_format.css | 13 +++++++++++++ docs/sphinx/source/conf.py | 5 ++--- pvlib/pvsystem.py | 11 ++++++----- setup.py | 2 +- 6 files changed, 22 insertions(+), 19 deletions(-) delete mode 100644 docs/sphinx/source/_static/bracketed_reference_number.css delete mode 100644 docs/sphinx/source/_static/no_reference_superscript.css create mode 100644 docs/sphinx/source/_static/reference_format.css diff --git a/docs/sphinx/source/_static/bracketed_reference_number.css b/docs/sphinx/source/_static/bracketed_reference_number.css deleted file mode 100644 index fa187734b6..0000000000 --- a/docs/sphinx/source/_static/bracketed_reference_number.css +++ /dev/null @@ -1,6 +0,0 @@ -.footnote-reference::before { - content: '['; -} -.footnote-reference::after { - content: ']'; -} \ No newline at end of file diff --git a/docs/sphinx/source/_static/no_reference_superscript.css b/docs/sphinx/source/_static/no_reference_superscript.css deleted file mode 100644 index 10ffe6b68b..0000000000 --- a/docs/sphinx/source/_static/no_reference_superscript.css +++ /dev/null @@ -1,4 +0,0 @@ -.footnote-reference { - font-size: 100% !important; /* default is 90% */ - top: 0.0em !important; /* default is -0.4em */ -} \ No newline at end of file diff --git a/docs/sphinx/source/_static/reference_format.css b/docs/sphinx/source/_static/reference_format.css new file mode 100644 index 0000000000..bdfa5661b8 --- /dev/null +++ b/docs/sphinx/source/_static/reference_format.css @@ -0,0 +1,13 @@ +/* no reference superscript */ +.footnote-reference { + font-size: 100% !important; /* default is 90% */ + top: 0.0em !important; /* default is -0.4em */ +} + +/* reference number in brackets */ +.footnote-reference::before { + content: '['; +} +.footnote-reference::after { + content: ']'; +} diff --git a/docs/sphinx/source/conf.py b/docs/sphinx/source/conf.py index 6728b47169..faf1b2dcee 100644 --- a/docs/sphinx/source/conf.py +++ b/docs/sphinx/source/conf.py @@ -218,11 +218,10 @@ # custom CSS workarounds def setup(app): # A workaround for the responsive tables always having annoying scrollbars. - app.add_stylesheet("no_scrollbars.css") + app.add_css_file("no_scrollbars.css") # Override footnote callout CSS to be normal text instead of superscript - app.add_stylesheet("no_reference_superscript.css") # In-line links to references as numbers in brackets. - app.add_stylesheet("bracketed_reference_number.css") + app.add_css_file("reference_format.css") # -- Options for LaTeX output --------------------------------------------- diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index 33f42522ff..8a20e5fdef 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -656,11 +656,12 @@ def first_solar_spectral_loss(self, pw, airmass_absolute): calculate the spectral loss modifier. The model coefficients are specific to the module's cell type, and are determined by searching for one of the following keys in self.module_parameters (in order): - 'first_solar_spectral_coefficients' (user-supplied coefficients) - 'Technology' - a string describing the cell type, can be read from - the CEC module parameter database - 'Material' - a string describing the cell type, can be read from - the Sandia module database. + + - 'first_solar_spectral_coefficients' (user-supplied coefficients) + - 'Technology' - a string describing the cell type, can be read from + the CEC module parameter database + - 'Material' - a string describing the cell type, can be read from + the Sandia module database. Parameters ---------- diff --git a/setup.py b/setup.py index 498d2739f8..ef6e7b6c15 100755 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ 'optional': ['cython', 'ephem', 'netcdf4', 'nrel-pysam', 'numba', 'pvfactors', 'siphon', 'statsmodels', 'tables', 'cftime >= 1.1.1'], - 'doc': ['ipython', 'matplotlib', 'sphinx >= 3.1.2', 'sphinx_rtd_theme', + 'doc': ['ipython', 'matplotlib', 'sphinx == 3.1.2', 'sphinx_rtd_theme==0.5.0', 'sphinx-gallery', 'docutils == 0.15.2', 'pillow', 'netcdf4', 'siphon', 'tables'], 'test': TESTS_REQUIRE From 0411c12dfc2d84983be223325c64873c9fef9b19 Mon Sep 17 00:00:00 2001 From: Veronica Guo Date: Wed, 14 Oct 2020 22:28:24 -0400 Subject: [PATCH 7/7] Fix lint error --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index ef6e7b6c15..6aa5d80bd8 100755 --- a/setup.py +++ b/setup.py @@ -48,9 +48,9 @@ 'optional': ['cython', 'ephem', 'netcdf4', 'nrel-pysam', 'numba', 'pvfactors', 'siphon', 'statsmodels', 'tables', 'cftime >= 1.1.1'], - 'doc': ['ipython', 'matplotlib', 'sphinx == 3.1.2', 'sphinx_rtd_theme==0.5.0', - 'sphinx-gallery', 'docutils == 0.15.2', 'pillow', - 'netcdf4', 'siphon', 'tables'], + 'doc': ['ipython', 'matplotlib', 'sphinx == 3.1.2', + 'sphinx_rtd_theme==0.5.0', 'sphinx-gallery', 'docutils == 0.15.2', + 'pillow', 'netcdf4', 'siphon', 'tables'], 'test': TESTS_REQUIRE } EXTRAS_REQUIRE['all'] = sorted(set(sum(EXTRAS_REQUIRE.values(), [])))