From 6f5ce4d2faf3a692c1a00a7cf4c30435f268f899 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Wed, 16 Oct 2024 18:50:46 +0100 Subject: [PATCH 01/14] Update variables_style_rules.csv --- pvlib/data/variables_style_rules.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/pvlib/data/variables_style_rules.csv b/pvlib/data/variables_style_rules.csv index 1954e036c2..abdfaecb60 100644 --- a/pvlib/data/variables_style_rules.csv +++ b/pvlib/data/variables_style_rules.csv @@ -10,6 +10,7 @@ bhi;beam/direct horizontal irradiance ghi;global horizontal irradiance ghi_extra;horizontal irradiance at top of atmosphere (extraterrestrial) gri;ground-reflected irradiance +spectra, spectra_components;spectral irradiance (components) ape;average photon energy aoi;angle of incidence between :math:`90\deg` and :math:`90\deg` aoi_projection;cos(aoi) From 3222761b6a0c49f03f48e78958a019a42d14e643 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Wed, 16 Oct 2024 18:53:16 +0100 Subject: [PATCH 02/14] Update v0.11.2.rst --- docs/sphinx/source/whatsnew/v0.11.2.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/sphinx/source/whatsnew/v0.11.2.rst b/docs/sphinx/source/whatsnew/v0.11.2.rst index 9d7129d50d..d362c7e845 100644 --- a/docs/sphinx/source/whatsnew/v0.11.2.rst +++ b/docs/sphinx/source/whatsnew/v0.11.2.rst @@ -16,6 +16,8 @@ Documentation ~~~~~~~~~~~~~ * Edited docstrings for :py:func:`~pvlib.pvsystem.dc_ohms_from_percent` and :py:func:`~pvlib.pvsystem.dc_ohmic_loss` for clarity. (:issue:`1601`, :pull:`2229`) +* Added variables `spectra` and `spectra_components` to the + :ref:`variables_style_rules` page. (:issue:`2150`, :pull:`2264`) Testing @@ -29,4 +31,5 @@ Requirements Contributors ~~~~~~~~~~~~ * Cliff Hansen (:ghuser:`cwhanse`) +* Rajiv Daxini (:ghuser:`RDaxini`) From 371e4dde5b35b84f0f7d0b36f2dd6da2c6fb1e4e Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Wed, 16 Oct 2024 18:55:50 +0100 Subject: [PATCH 03/14] not sure what happened here after merge with main --- docs/sphinx/source/whatsnew/v0.11.2.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.11.2.rst b/docs/sphinx/source/whatsnew/v0.11.2.rst index cc7d00f5c7..766d318fb4 100644 --- a/docs/sphinx/source/whatsnew/v0.11.2.rst +++ b/docs/sphinx/source/whatsnew/v0.11.2.rst @@ -18,11 +18,10 @@ Documentation :py:func:`~pvlib.pvsystem.dc_ohmic_loss` for clarity. (:issue:`1601`, :pull:`2229`) * Added variables `spectra` and `spectra_components` to the :ref:`variables_style_rules` page. (:issue:`2150`, :pull:`2264`) - - :py:func:`~pvlib.pvsystem.dc_ohmic_losses` for clarity. (:issue:`1601`, :pull:`2229`) * Updated :py:func:`~pvlib.irradiance.reindl` to include definitions of terms and a new "notes" section (:issue:`2183`, :pull:`2193`) + Testing ~~~~~~~ From 472f2501dc39f7c36a1a5f74ac3ab84af5465160 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Thu, 17 Oct 2024 21:34:01 +0100 Subject: [PATCH 04/14] Update v0.11.2.rst --- docs/sphinx/source/whatsnew/v0.11.2.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.11.2.rst b/docs/sphinx/source/whatsnew/v0.11.2.rst index 766d318fb4..044298d2f6 100644 --- a/docs/sphinx/source/whatsnew/v0.11.2.rst +++ b/docs/sphinx/source/whatsnew/v0.11.2.rst @@ -15,7 +15,7 @@ Enhancements Documentation ~~~~~~~~~~~~~ * Edited docstrings for :py:func:`~pvlib.pvsystem.dc_ohms_from_percent` and - :py:func:`~pvlib.pvsystem.dc_ohmic_loss` for clarity. (:issue:`1601`, :pull:`2229`) + :py:func:`~pvlib.pvsystem.dc_ohmic_losses` for clarity. (:issue:`1601`, :pull:`2229`) * Added variables `spectra` and `spectra_components` to the :ref:`variables_style_rules` page. (:issue:`2150`, :pull:`2264`) * Updated :py:func:`~pvlib.irradiance.reindl` to include definitions of terms From e0ecc4c193548815756090bc3836c41bb8cf9d86 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 1 Nov 2024 10:49:23 -0600 Subject: [PATCH 05/14] update whatsnew and glossary page --- docs/sphinx/source/user_guide/nomenclature.rst | 6 ++++++ docs/sphinx/source/whatsnew/v0.11.2.rst | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/sphinx/source/user_guide/nomenclature.rst b/docs/sphinx/source/user_guide/nomenclature.rst index a89da06cbf..b24baab80b 100644 --- a/docs/sphinx/source/user_guide/nomenclature.rst +++ b/docs/sphinx/source/user_guide/nomenclature.rst @@ -142,6 +142,12 @@ There is a convention on consistent variable names throughout the library: solar_zenith Zenith angle of the sun in degrees + spectra, spectra_components + Spectral irradiance (components) [Wm⁻²nm⁻¹]. The amount of energy + incident on a horizontal unit area per unit time and per unit + wavelength. As with broadband irradiance, global spectral irradiance + is composed of direct amd diffuse components. + surface_azimuth Azimuth angle of the surface diff --git a/docs/sphinx/source/whatsnew/v0.11.2.rst b/docs/sphinx/source/whatsnew/v0.11.2.rst index 78f9caa969..c49faada95 100644 --- a/docs/sphinx/source/whatsnew/v0.11.2.rst +++ b/docs/sphinx/source/whatsnew/v0.11.2.rst @@ -26,7 +26,7 @@ Documentation * Edited docstrings for :py:func:`~pvlib.pvsystem.dc_ohms_from_percent` and :py:func:`~pvlib.pvsystem.dc_ohmic_losses` for clarity. (:issue:`1601`, :pull:`2229`) * Added variables `spectra` and `spectra_components` to the - :ref:`variables_style_rules` page. (:issue:`2150`, :pull:`2264`) + :ref:`nomenclature` page. (:issue:`2150`, :pull:`2264`) * Added a new citation style guide (:ref:`references`) to the contributing page. (:issue:`2202`, :pull:`2226`) * Updated :py:func:`~pvlib.irradiance.reindl` to include definitions of terms From 9d00d9aa5687afd32dba639b779e47c190a674c3 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:24:48 -0600 Subject: [PATCH 06/14] Update spectrl2.py --- pvlib/spectrum/spectrl2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pvlib/spectrum/spectrl2.py b/pvlib/spectrum/spectrl2.py index b022d79371..fd7ea6a3fd 100644 --- a/pvlib/spectrum/spectrl2.py +++ b/pvlib/spectrum/spectrl2.py @@ -228,10 +228,11 @@ def spectrl2(apparent_zenith, aoi, surface_tilt, ground_albedo, Returns ------- spectra_components : dict - A dict of arrays. With the exception of `wavelength`, which has length + A dict of arrays. With the exception of `wavelength`, which has length 122, each array has shape (122, N) where N is the length of the input ``apparent_zenith``. All values are spectral irradiance with units Wm⁻²nm⁻¹, except for `wavelength`, which is in nanometers. + See :term:`spectra, spectra_components`. * wavelength * dni_extra From fff44190d7148f5915c13b8c6d71397b191f4d0d Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:41:06 -0600 Subject: [PATCH 07/14] Update irradiance.py --- pvlib/spectrum/irradiance.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pvlib/spectrum/irradiance.py b/pvlib/spectrum/irradiance.py index cb3e5e1ddb..bc55d0e948 100644 --- a/pvlib/spectrum/irradiance.py +++ b/pvlib/spectrum/irradiance.py @@ -190,6 +190,7 @@ def average_photon_energy(spectra): spectra : pandas.Series or pandas.DataFrame Spectral irradiance, must be positive. [Wm⁻²nm⁻¹] + See :term:`spectra, spectra_components`. A single spectrum must be a :py:class:`pandas.Series` with wavelength [nm] as the index, while multiple spectra must be rows in a From 80a0614aac877f40624d2fffdccd12d389f80806 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:41:17 -0600 Subject: [PATCH 08/14] typo --- docs/sphinx/source/user_guide/nomenclature.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sphinx/source/user_guide/nomenclature.rst b/docs/sphinx/source/user_guide/nomenclature.rst index b24baab80b..4e82cc8c07 100644 --- a/docs/sphinx/source/user_guide/nomenclature.rst +++ b/docs/sphinx/source/user_guide/nomenclature.rst @@ -146,7 +146,7 @@ There is a convention on consistent variable names throughout the library: Spectral irradiance (components) [Wm⁻²nm⁻¹]. The amount of energy incident on a horizontal unit area per unit time and per unit wavelength. As with broadband irradiance, global spectral irradiance - is composed of direct amd diffuse components. + is composed of direct and diffuse components. surface_azimuth Azimuth angle of the surface From a13cc147aedac9ac928f6d30d44155d577a76a25 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:46:18 -0600 Subject: [PATCH 09/14] update spectrl2.py and spectrum irradiance.py --- pvlib/spectrum/irradiance.py | 2 +- pvlib/spectrum/spectrl2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/spectrum/irradiance.py b/pvlib/spectrum/irradiance.py index bc55d0e948..c23d6960d2 100644 --- a/pvlib/spectrum/irradiance.py +++ b/pvlib/spectrum/irradiance.py @@ -190,7 +190,7 @@ def average_photon_energy(spectra): spectra : pandas.Series or pandas.DataFrame Spectral irradiance, must be positive. [Wm⁻²nm⁻¹] - See :term:`spectra, spectra_components`. + See :term:`spectra `. A single spectrum must be a :py:class:`pandas.Series` with wavelength [nm] as the index, while multiple spectra must be rows in a diff --git a/pvlib/spectrum/spectrl2.py b/pvlib/spectrum/spectrl2.py index fd7ea6a3fd..b655a4b828 100644 --- a/pvlib/spectrum/spectrl2.py +++ b/pvlib/spectrum/spectrl2.py @@ -232,7 +232,7 @@ def spectrl2(apparent_zenith, aoi, surface_tilt, ground_albedo, 122, each array has shape (122, N) where N is the length of the input ``apparent_zenith``. All values are spectral irradiance with units Wm⁻²nm⁻¹, except for `wavelength`, which is in nanometers. - See :term:`spectra, spectra_components`. + See :term:`spectra_components `. * wavelength * dni_extra From b9daa021d0959a2059d63d359f119dca1896b059 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 1 Nov 2024 12:05:02 -0600 Subject: [PATCH 10/14] grammar -- periods before/after units(?) --- pvlib/spectrum/irradiance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/spectrum/irradiance.py b/pvlib/spectrum/irradiance.py index c23d6960d2..04c4eeb709 100644 --- a/pvlib/spectrum/irradiance.py +++ b/pvlib/spectrum/irradiance.py @@ -189,7 +189,7 @@ def average_photon_energy(spectra): ---------- spectra : pandas.Series or pandas.DataFrame - Spectral irradiance, must be positive. [Wm⁻²nm⁻¹] + Spectral irradiance, must be positive [Wm⁻²nm⁻¹]. See :term:`spectra `. A single spectrum must be a :py:class:`pandas.Series` with wavelength From 7eef7713f0e25de3590333b959576128d91cc474 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 5 Nov 2024 08:46:23 -0700 Subject: [PATCH 11/14] Apply suggestions from code review Co-authored-by: Kevin Anderson --- docs/sphinx/source/user_guide/nomenclature.rst | 5 +++-- pvlib/spectrum/irradiance.py | 2 +- pvlib/spectrum/spectrl2.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/sphinx/source/user_guide/nomenclature.rst b/docs/sphinx/source/user_guide/nomenclature.rst index 4e82cc8c07..180f0a298f 100644 --- a/docs/sphinx/source/user_guide/nomenclature.rst +++ b/docs/sphinx/source/user_guide/nomenclature.rst @@ -142,9 +142,10 @@ There is a convention on consistent variable names throughout the library: solar_zenith Zenith angle of the sun in degrees - spectra, spectra_components + spectra + spectra_components Spectral irradiance (components) [Wm⁻²nm⁻¹]. The amount of energy - incident on a horizontal unit area per unit time and per unit + incident on a unit area per unit time and per unit wavelength. As with broadband irradiance, global spectral irradiance is composed of direct and diffuse components. diff --git a/pvlib/spectrum/irradiance.py b/pvlib/spectrum/irradiance.py index 04c4eeb709..14b2da27ba 100644 --- a/pvlib/spectrum/irradiance.py +++ b/pvlib/spectrum/irradiance.py @@ -190,7 +190,7 @@ def average_photon_energy(spectra): spectra : pandas.Series or pandas.DataFrame Spectral irradiance, must be positive [Wm⁻²nm⁻¹]. - See :term:`spectra `. + See :term:`spectra`. A single spectrum must be a :py:class:`pandas.Series` with wavelength [nm] as the index, while multiple spectra must be rows in a diff --git a/pvlib/spectrum/spectrl2.py b/pvlib/spectrum/spectrl2.py index b655a4b828..38739efff3 100644 --- a/pvlib/spectrum/spectrl2.py +++ b/pvlib/spectrum/spectrl2.py @@ -232,7 +232,7 @@ def spectrl2(apparent_zenith, aoi, surface_tilt, ground_albedo, 122, each array has shape (122, N) where N is the length of the input ``apparent_zenith``. All values are spectral irradiance with units Wm⁻²nm⁻¹, except for `wavelength`, which is in nanometers. - See :term:`spectra_components `. + See :term:`spectra_components`. * wavelength * dni_extra From 1b675a55745a92768df0c503ef939cd2446c8a4e Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:38:12 -0700 Subject: [PATCH 12/14] Update v0.11.2.rst --- docs/sphinx/source/whatsnew/v0.11.2.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.11.2.rst b/docs/sphinx/source/whatsnew/v0.11.2.rst index c49faada95..501a546aa4 100644 --- a/docs/sphinx/source/whatsnew/v0.11.2.rst +++ b/docs/sphinx/source/whatsnew/v0.11.2.rst @@ -25,8 +25,6 @@ Documentation ~~~~~~~~~~~~~ * Edited docstrings for :py:func:`~pvlib.pvsystem.dc_ohms_from_percent` and :py:func:`~pvlib.pvsystem.dc_ohmic_losses` for clarity. (:issue:`1601`, :pull:`2229`) -* Added variables `spectra` and `spectra_components` to the - :ref:`nomenclature` page. (:issue:`2150`, :pull:`2264`) * Added a new citation style guide (:ref:`references`) to the contributing page. (:issue:`2202`, :pull:`2226`) * Updated :py:func:`~pvlib.irradiance.reindl` to include definitions of terms @@ -35,6 +33,8 @@ Documentation page, using the sphinx glossary directive. (:issue:`1421`, :pull:`2234`) * Explained how to write docstrings for new functions in :ref:`example-docstring` (:discussion:`2081`, :pull:`2254`) +* Added the following variables to the :ref:`nomenclature` page: + - `spectra` and `spectra_components` (:issue:`2150`, :pull:`2264`) Testing From 6dbebbaad888b5a0df8b5a2f9b26c355e73f8d93 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:46:02 -0700 Subject: [PATCH 13/14] fix whatsnew formatting --- docs/sphinx/source/whatsnew/v0.11.2.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/sphinx/source/whatsnew/v0.11.2.rst b/docs/sphinx/source/whatsnew/v0.11.2.rst index 501a546aa4..eb128ee3b0 100644 --- a/docs/sphinx/source/whatsnew/v0.11.2.rst +++ b/docs/sphinx/source/whatsnew/v0.11.2.rst @@ -34,6 +34,7 @@ Documentation * Explained how to write docstrings for new functions in :ref:`example-docstring` (:discussion:`2081`, :pull:`2254`) * Added the following variables to the :ref:`nomenclature` page: + - `spectra` and `spectra_components` (:issue:`2150`, :pull:`2264`) From 1ba119270e5e5307c91bec4ed0e27e8414426db0 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:57:52 -0700 Subject: [PATCH 14/14] formatting attempt #2 --- docs/sphinx/source/whatsnew/v0.11.2.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.11.2.rst b/docs/sphinx/source/whatsnew/v0.11.2.rst index eb128ee3b0..a07f4bf43d 100644 --- a/docs/sphinx/source/whatsnew/v0.11.2.rst +++ b/docs/sphinx/source/whatsnew/v0.11.2.rst @@ -35,7 +35,7 @@ Documentation (:discussion:`2081`, :pull:`2254`) * Added the following variables to the :ref:`nomenclature` page: - - `spectra` and `spectra_components` (:issue:`2150`, :pull:`2264`) + - `spectra` and `spectra_components` (:issue:`2150`, :pull:`2264`) Testing