From ee88e866ed62125f299d4f54e01165114bec8962 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Mon, 25 Nov 2024 14:51:37 -0700 Subject: [PATCH 01/20] non-breaking: clearsky_ghi -> ghi_clear --- pvlib/clearsky.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pvlib/clearsky.py b/pvlib/clearsky.py index eb97691ba3..be75ecd47a 100644 --- a/pvlib/clearsky.py +++ b/pvlib/clearsky.py @@ -327,13 +327,13 @@ def haurwitz(apparent_zenith): ''' cos_zenith = tools.cosd(apparent_zenith.values) - clearsky_ghi = np.zeros_like(apparent_zenith.values) + ghi_clear = np.zeros_like(apparent_zenith.values) cos_zen_gte_0 = cos_zenith > 0 - clearsky_ghi[cos_zen_gte_0] = (1098.0 * cos_zenith[cos_zen_gte_0] * - np.exp(-0.059/cos_zenith[cos_zen_gte_0])) + ghi_clear[cos_zen_gte_0] = (1098.0 * cos_zenith[cos_zen_gte_0] * + np.exp(-0.059/cos_zenith[cos_zen_gte_0])) df_out = pd.DataFrame(index=apparent_zenith.index, - data=clearsky_ghi, + data=ghi_clear, columns=['ghi']) return df_out From ed0d2de8f4f6bb2e9d0eacfc6ccc54779174a6a4 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Mon, 25 Nov 2024 14:53:05 -0700 Subject: [PATCH 02/20] breaking: clearsky_ghi & ghi_clearsky -> ghi_clear --- pvlib/irradiance.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index cecba6237b..1679e8f3f7 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -16,7 +16,7 @@ from pvlib import atmosphere, solarposition, tools import pvlib # used to avoid dni name collision in complete_irradiance -from pvlib._deprecation import pvlibDeprecationWarning +from pvlib._deprecation import pvlibDeprecationWarning, renamed_kwarg_warning import warnings @@ -1614,6 +1614,11 @@ def ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth, return ghi +@renamed_kwarg_warning( + since='11.2', + old_param_name='clearsky_ghi', + new_param_name='ghi_clear', + removal="12.0") def clearsky_index(ghi, clearsky_ghi, max_clearsky_index=2.0): """ Calculate the clearsky index. @@ -2151,6 +2156,11 @@ def _dirint_bins(times, kt_prime, zenith, w, delta_kt_prime): return kt_prime_bin, zenith_bin, w_bin, delta_kt_prime_bin +@renamed_kwarg_warning( + since='11.2', + old_param_name='ghi_clearsky', + new_param_name='ghi_clear', + removal="12.0") def dirindex(ghi, ghi_clearsky, dni_clearsky, zenith, times, pressure=101325., use_delta_kt_prime=True, temp_dew=None, min_cos_zenith=0.065, max_zenith=87): From b55f56e822cf92e35c9aabbae1f3b4131454da5f Mon Sep 17 00:00:00 2001 From: RDaxini Date: Mon, 25 Nov 2024 15:32:51 -0700 Subject: [PATCH 03/20] *_test_not_working_* --- pvlib/tests/test_irradiance.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pvlib/tests/test_irradiance.py b/pvlib/tests/test_irradiance.py index 64f7d27b5e..15ba839903 100644 --- a/pvlib/tests/test_irradiance.py +++ b/pvlib/tests/test_irradiance.py @@ -1235,6 +1235,12 @@ def test_clearsky_index(): assert_series_equal(out, expected) +def test_clearsky_index_renaming(): + with pytest.warns(pvlibDeprecationWarning, match='ghi_clear'): + ghi, clearsky_ghi = 200, 300 + irradiance.clearsky_index(ghi, clearsky_ghi) + + def test_clearness_index(): ghi = np.array([-1, 0, 1, 1000]) solar_zenith = np.array([180, 90, 89.999, 0]) From 8a90595fd6ae2b568869e23db5b3240f065154cd Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:07:08 -0700 Subject: [PATCH 04/20] Apply suggestions from code review Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> --- pvlib/irradiance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 1679e8f3f7..4664cf871d 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -1619,7 +1619,7 @@ def ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth, old_param_name='clearsky_ghi', new_param_name='ghi_clear', removal="12.0") -def clearsky_index(ghi, clearsky_ghi, max_clearsky_index=2.0): +def clearsky_index(ghi, ghi_clear, max_clearsky_index=2.0): """ Calculate the clearsky index. @@ -2161,7 +2161,7 @@ def _dirint_bins(times, kt_prime, zenith, w, delta_kt_prime): old_param_name='ghi_clearsky', new_param_name='ghi_clear', removal="12.0") -def dirindex(ghi, ghi_clearsky, dni_clearsky, zenith, times, pressure=101325., +def dirindex(ghi, ghi_clear, dni_clearsky, zenith, times, pressure=101325., use_delta_kt_prime=True, temp_dew=None, min_cos_zenith=0.065, max_zenith=87): """ From ef4b635653bf1beea3f125c32d67e6501c713a2a Mon Sep 17 00:00:00 2001 From: RDaxini Date: Mon, 25 Nov 2024 16:17:54 -0700 Subject: [PATCH 05/20] change all variables --- pvlib/irradiance.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 4664cf871d..f6f9fc6976 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -1631,7 +1631,7 @@ def clearsky_index(ghi, ghi_clear, max_clearsky_index=2.0): ghi : numeric Global horizontal irradiance. [Wm⁻²] - clearsky_ghi : numeric + ghi_clear : numeric Modeled clearsky GHI max_clearsky_index : numeric, default 2.0 @@ -1643,12 +1643,12 @@ def clearsky_index(ghi, ghi_clear, max_clearsky_index=2.0): clearsky_index : numeric Clearsky index """ - clearsky_index = ghi / clearsky_ghi + clearsky_index = ghi / ghi_clear # set +inf, -inf, and nans to zero clearsky_index = np.where(~np.isfinite(clearsky_index), 0, clearsky_index) # but preserve nans in the input arrays - input_is_nan = ~np.isfinite(ghi) | ~np.isfinite(clearsky_ghi) + input_is_nan = ~np.isfinite(ghi) | ~np.isfinite(ghi_clear) clearsky_index = np.where(input_is_nan, np.nan, clearsky_index) clearsky_index = np.maximum(clearsky_index, 0) @@ -2169,7 +2169,7 @@ def dirindex(ghi, ghi_clear, dni_clearsky, zenith, times, pressure=101325., The DIRINDEX model [1]_ modifies the DIRINT model implemented in :py:func:`pvlib.irradiance.dirint` by taking into account information - from a clear sky model. It is recommended that ``ghi_clearsky`` be + from a clear sky model. It is recommended that ``ghi_clear`` be calculated using the Ineichen clear sky model :py:func:`pvlib.clearsky.ineichen` with ``perez_enhancement=True``. @@ -2180,7 +2180,7 @@ def dirindex(ghi, ghi_clear, dni_clearsky, zenith, times, pressure=101325., ghi : array-like Global horizontal irradiance. [Wm⁻²] - ghi_clearsky : array-like + ghi_clear : array-like Global horizontal irradiance from clear sky model. [Wm⁻²] dni_clearsky : array-like @@ -2242,7 +2242,7 @@ def dirindex(ghi, ghi_clear, dni_clearsky, zenith, times, pressure=101325., temp_dew=temp_dew, min_cos_zenith=min_cos_zenith, max_zenith=max_zenith) - dni_dirint_clearsky = dirint(ghi_clearsky, zenith, times, + dni_dirint_clearsky = dirint(ghi_clear, zenith, times, pressure=pressure, use_delta_kt_prime=use_delta_kt_prime, temp_dew=temp_dew, From 49c52687de3076b4f1de2f7c6303fca07fbf6492 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 26 Nov 2024 07:47:19 -0700 Subject: [PATCH 06/20] Update pvlib/tests/test_irradiance.py Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> --- pvlib/tests/test_irradiance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/tests/test_irradiance.py b/pvlib/tests/test_irradiance.py index 15ba839903..c493002121 100644 --- a/pvlib/tests/test_irradiance.py +++ b/pvlib/tests/test_irradiance.py @@ -1238,7 +1238,7 @@ def test_clearsky_index(): def test_clearsky_index_renaming(): with pytest.warns(pvlibDeprecationWarning, match='ghi_clear'): ghi, clearsky_ghi = 200, 300 - irradiance.clearsky_index(ghi, clearsky_ghi) + irradiance.clearsky_index(ghi, clearsky_ghi=clearsky_ghi) def test_clearness_index(): From 75c2c38bff3e96af8cbc542f9ec1967b56eb446b Mon Sep 17 00:00:00 2001 From: RDaxini Date: Tue, 26 Nov 2024 10:39:04 -0700 Subject: [PATCH 07/20] dirindex deprecation test --- pvlib/tests/test_irradiance.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/pvlib/tests/test_irradiance.py b/pvlib/tests/test_irradiance.py index c493002121..e3d3e36554 100644 --- a/pvlib/tests/test_irradiance.py +++ b/pvlib/tests/test_irradiance.py @@ -1094,6 +1094,28 @@ def test_dirindex(times): equal_nan=True) +def test_dirindex_ghi_clearsky_deprecation(): + with pytest.warns(pvlibDeprecationWarning, match='ghi_clear'): + times = pd.DatetimeIndex(['2014-06-24T18-1200']) + ghi = pd.Series([1038.62], index=times) + ghi_clearsky = pd.Series( + np.array([1042.48031487]), + index=times + ) + dni_clearsky = pd.Series( + np.array([939.95469881]), + index=times + ) + zenith = pd.Series( + np.array([10.56413562]), + index=times + ) + pressure, tdew = 93193, 10 + irradiance.dirindex( + ghi=ghi, ghi_clearsky=ghi_clearsky, dni_clearsky=dni_clearsky, + zenith=zenith, times=times, pressure=pressure, temp_dew=tdew) + + def test_dirindex_min_cos_zenith_max_zenith(): # map out behavior under difficult conditions with various # limiting kwargs settings @@ -1235,7 +1257,7 @@ def test_clearsky_index(): assert_series_equal(out, expected) -def test_clearsky_index_renaming(): +def test_clearsky_index_clearsky_ghi_deprecation(): with pytest.warns(pvlibDeprecationWarning, match='ghi_clear'): ghi, clearsky_ghi = 200, 300 irradiance.clearsky_index(ghi, clearsky_ghi=clearsky_ghi) From b1d6793141f6afbfae51a1b1f01403b42cc64afb Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:20:12 -0700 Subject: [PATCH 08/20] Update pvlib/tests/test_irradiance.py Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> --- pvlib/tests/test_irradiance.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pvlib/tests/test_irradiance.py b/pvlib/tests/test_irradiance.py index e3d3e36554..c46496bf1c 100644 --- a/pvlib/tests/test_irradiance.py +++ b/pvlib/tests/test_irradiance.py @@ -1257,6 +1257,7 @@ def test_clearsky_index(): assert_series_equal(out, expected) +@fail_on_pvlib_version("0.12") def test_clearsky_index_clearsky_ghi_deprecation(): with pytest.warns(pvlibDeprecationWarning, match='ghi_clear'): ghi, clearsky_ghi = 200, 300 From 0af7ffaf2518f10713c8d887afd4464c6bad7a17 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Tue, 26 Nov 2024 15:45:34 -0700 Subject: [PATCH 09/20] add @fail_on_pvlib_version("0.12") decorator --- pvlib/tests/test_irradiance.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pvlib/tests/test_irradiance.py b/pvlib/tests/test_irradiance.py index c46496bf1c..62366625c4 100644 --- a/pvlib/tests/test_irradiance.py +++ b/pvlib/tests/test_irradiance.py @@ -18,7 +18,7 @@ requires_numba ) -from pvlib._deprecation import pvlibDeprecationWarning +from pvlib._deprecation import pvlibDeprecationWarning, fail_on_pvlib_version # fixtures create realistic test input data # test input data generated at Location(32.2, -111, 'US/Arizona', 700) @@ -1094,6 +1094,7 @@ def test_dirindex(times): equal_nan=True) +@fail_on_pvlib_version("0.12") def test_dirindex_ghi_clearsky_deprecation(): with pytest.warns(pvlibDeprecationWarning, match='ghi_clear'): times = pd.DatetimeIndex(['2014-06-24T18-1200']) From 002b67159f2288581abfa172347b579a21810fdf Mon Sep 17 00:00:00 2001 From: RDaxini Date: Tue, 26 Nov 2024 15:59:06 -0700 Subject: [PATCH 10/20] Update test_irradiance.py --- pvlib/tests/test_irradiance.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pvlib/tests/test_irradiance.py b/pvlib/tests/test_irradiance.py index 62366625c4..384d81c1a8 100644 --- a/pvlib/tests/test_irradiance.py +++ b/pvlib/tests/test_irradiance.py @@ -15,10 +15,11 @@ assert_frame_equal, assert_series_equal, requires_ephem, - requires_numba + requires_numba, + fail_on_pvlib_version ) -from pvlib._deprecation import pvlibDeprecationWarning, fail_on_pvlib_version +from pvlib._deprecation import pvlibDeprecationWarning # fixtures create realistic test input data # test input data generated at Location(32.2, -111, 'US/Arizona', 700) From a68dda32b42be4465eefd334bda9cc651a67e56d Mon Sep 17 00:00:00 2001 From: RDaxini Date: Wed, 27 Nov 2024 14:26:57 -0700 Subject: [PATCH 11/20] correct version number --- pvlib/irradiance.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index f6f9fc6976..8f86c5aae6 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -1615,10 +1615,10 @@ def ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth, @renamed_kwarg_warning( - since='11.2', + since='0.11.2', old_param_name='clearsky_ghi', new_param_name='ghi_clear', - removal="12.0") + removal="0.12.0") def clearsky_index(ghi, ghi_clear, max_clearsky_index=2.0): """ Calculate the clearsky index. @@ -2157,10 +2157,10 @@ def _dirint_bins(times, kt_prime, zenith, w, delta_kt_prime): @renamed_kwarg_warning( - since='11.2', + since='0.11.2', old_param_name='ghi_clearsky', new_param_name='ghi_clear', - removal="12.0") + removal="0.12.0") def dirindex(ghi, ghi_clear, dni_clearsky, zenith, times, pressure=101325., use_delta_kt_prime=True, temp_dew=None, min_cos_zenith=0.065, max_zenith=87): From aff87e9475af13e0bff8e927013ed426923e374e Mon Sep 17 00:00:00 2001 From: RDaxini Date: Fri, 13 Dec 2024 14:28:20 -0700 Subject: [PATCH 12/20] Update irradiance.py --- pvlib/irradiance.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index ac3c9e5df1..73517f209a 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -1618,7 +1618,7 @@ def ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth, since='0.11.2', old_param_name='clearsky_ghi', new_param_name='ghi_clear', - removal="0.12.0") + removal="0.13.0") def clearsky_index(ghi, ghi_clear, max_clearsky_index=2.0): """ Calculate the clearsky index. @@ -2156,12 +2156,17 @@ def _dirint_bins(times, kt_prime, zenith, w, delta_kt_prime): return kt_prime_bin, zenith_bin, w_bin, delta_kt_prime_bin +@renamed_kwarg_warning( + since='0.11.2', + old_param_name='ghi_clearsky', + new_param_name='ghi_clear', + removal="0.13.0") @renamed_kwarg_warning( since='0.11.2', old_param_name='dni_clearsky', new_param_name='dni_clear', removal="0.13.0") -def dirindex(ghi, ghi_clearsky, dni_clear, zenith, times, pressure=101325., +def dirindex(ghi, ghi_clear, dni_clear, zenith, times, pressure=101325., use_delta_kt_prime=True, temp_dew=None, min_cos_zenith=0.065, max_zenith=87): """ @@ -2183,6 +2188,9 @@ def dirindex(ghi, ghi_clearsky, dni_clear, zenith, times, pressure=101325., ghi_clear : array-like Global horizontal irradiance from clear sky model. [Wm⁻²] + .. versionchanged:: 0.11.2 + Renamed from ``ghi_clearsky`` to ``ghi_clear``. + dni_clear : array-like Direct normal irradiance from clear sky model. [Wm⁻²] From 9215eab5faa165db1934ba2b1d083c39e279d1e5 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Fri, 13 Dec 2024 14:36:13 -0700 Subject: [PATCH 13/20] 0.12->0.13 in test_irradiance.py --- pvlib/tests/test_irradiance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/tests/test_irradiance.py b/pvlib/tests/test_irradiance.py index b5c3756b3d..8b8939cfd1 100644 --- a/pvlib/tests/test_irradiance.py +++ b/pvlib/tests/test_irradiance.py @@ -1095,7 +1095,7 @@ def test_dirindex(times): equal_nan=True) -@fail_on_pvlib_version("0.12") +@fail_on_pvlib_version("0.13") def test_dirindex_ghi_clearsky_deprecation(): with pytest.warns(pvlibDeprecationWarning, match='ghi_clear'): times = pd.DatetimeIndex(['2014-06-24T18-1200']) @@ -1283,7 +1283,7 @@ def test_clearsky_index(): assert_series_equal(out, expected) -@fail_on_pvlib_version("0.12") +@fail_on_pvlib_version("0.13") def test_clearsky_index_clearsky_ghi_deprecation(): with pytest.warns(pvlibDeprecationWarning, match='ghi_clear'): ghi, clearsky_ghi = 200, 300 From 742dd347fdf2a7a0a1b703ec4835f31767943cf3 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Fri, 13 Dec 2024 14:40:09 -0700 Subject: [PATCH 14/20] 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 e94c0f8734..b2fb64fa9c 100644 --- a/docs/sphinx/source/whatsnew/v0.11.2.rst +++ b/docs/sphinx/source/whatsnew/v0.11.2.rst @@ -9,6 +9,9 @@ Deprecations * Deprecated terms ``dni_clearsky`` and ``clearsky_dni``, replaced with ``dni_clear``. Affected functions are :py:func:`~pvlib.irradiance.dirindex` and :py:func:`~pvlib.irradiance.dni`. (:issue:`2272`, :pull:`2274`) +* Deprecated term ``ghi_clearsky``, replaced with ``ghi_clear``. + Affected functions are :py:func:`~pvlib.irradiance.dirindex` and :py:func:`~pvlib.irradiance.clearsky_index`. + (:issue:`2272`, :pull:`2306`) Enhancements From 437c2d3a893a825d05cddc3eaa9476643e7b9996 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sat, 14 Dec 2024 10:11:06 -0700 Subject: [PATCH 15/20] Update pvlib/tests/test_irradiance.py Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> --- pvlib/tests/test_irradiance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/tests/test_irradiance.py b/pvlib/tests/test_irradiance.py index 8b8939cfd1..fe28f4b930 100644 --- a/pvlib/tests/test_irradiance.py +++ b/pvlib/tests/test_irradiance.py @@ -1114,7 +1114,7 @@ def test_dirindex_ghi_clearsky_deprecation(): ) pressure, tdew = 93193, 10 irradiance.dirindex( - ghi=ghi, ghi_clearsky=ghi_clearsky, dni_clearsky=dni_clearsky, + ghi=ghi, ghi_clearsky=ghi_clearsky, dni_clear=dni_clearsky, zenith=zenith, times=times, pressure=pressure, temp_dew=tdew) From 26e361827d13fce1d54ca716d2f15363ed70511a Mon Sep 17 00:00:00 2001 From: RDaxini Date: Mon, 16 Dec 2024 14:18:24 -0700 Subject: [PATCH 16/20] indents --- pvlib/irradiance.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 73517f209a..b7dc233f80 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -2189,13 +2189,13 @@ def dirindex(ghi, ghi_clear, dni_clear, zenith, times, pressure=101325., Global horizontal irradiance from clear sky model. [Wm⁻²] .. versionchanged:: 0.11.2 - Renamed from ``ghi_clearsky`` to ``ghi_clear``. + Renamed from ``ghi_clearsky`` to ``ghi_clear``. dni_clear : array-like Direct normal irradiance from clear sky model. [Wm⁻²] - .. versionchanged:: 0.11.2 - Renamed from ``dni_clearsky`` to ``dni_clear``. + .. versionchanged:: 0.11.2 + Renamed from ``dni_clearsky`` to ``dni_clear``. zenith : array-like True (not refraction-corrected) zenith angles in decimal From 113ab9bec2242d44837cebc4c7cf53fb9c00a05c Mon Sep 17 00:00:00 2001 From: RDaxini Date: Mon, 16 Dec 2024 14:19:33 -0700 Subject: [PATCH 17/20] add missing .. versionchanged:: --- pvlib/irradiance.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index b7dc233f80..2534f2f81d 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -1634,6 +1634,9 @@ def clearsky_index(ghi, ghi_clear, max_clearsky_index=2.0): ghi_clear : numeric Modeled clearsky GHI + .. versionchanged:: 0.11.2 + Renamed from ``ghi_clearsky`` to ``ghi_clear``. + max_clearsky_index : numeric, default 2.0 Maximum value of the clearsky index. The default, 2.0, allows for over-irradiance events typically seen in sub-hourly data. From 447f031030bebb3299d3abf0ae233f0904b2a02d Mon Sep 17 00:00:00 2001 From: RDaxini Date: Mon, 16 Dec 2024 14:24:01 -0700 Subject: [PATCH 18/20] refine test --- pvlib/tests/test_irradiance.py | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/pvlib/tests/test_irradiance.py b/pvlib/tests/test_irradiance.py index fe28f4b930..9352e978e6 100644 --- a/pvlib/tests/test_irradiance.py +++ b/pvlib/tests/test_irradiance.py @@ -1097,22 +1097,13 @@ def test_dirindex(times): @fail_on_pvlib_version("0.13") def test_dirindex_ghi_clearsky_deprecation(): + times = pd.DatetimeIndex(['2014-06-24T18-1200']) + ghi = pd.Series([1038.62], index=times) + ghi_clearsky = pd.Series([1042.48031487], index=times) + dni_clearsky = pd.Series([939.95469881], index=times) + zenith = pd.Series([10.56413562], index=times) + pressure, tdew = 93193, 10 with pytest.warns(pvlibDeprecationWarning, match='ghi_clear'): - times = pd.DatetimeIndex(['2014-06-24T18-1200']) - ghi = pd.Series([1038.62], index=times) - ghi_clearsky = pd.Series( - np.array([1042.48031487]), - index=times - ) - dni_clearsky = pd.Series( - np.array([939.95469881]), - index=times - ) - zenith = pd.Series( - np.array([10.56413562]), - index=times - ) - pressure, tdew = 93193, 10 irradiance.dirindex( ghi=ghi, ghi_clearsky=ghi_clearsky, dni_clear=dni_clearsky, zenith=zenith, times=times, pressure=pressure, temp_dew=tdew) From 15bffc5fefa00c27907dc68ae4ea546f80da6b43 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Mon, 16 Dec 2024 14:46:52 -0700 Subject: [PATCH 19/20] Update pvlib/irradiance.py Co-authored-by: Kevin Anderson --- pvlib/irradiance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 2534f2f81d..6c52049287 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -2191,8 +2191,8 @@ def dirindex(ghi, ghi_clear, dni_clear, zenith, times, pressure=101325., ghi_clear : array-like Global horizontal irradiance from clear sky model. [Wm⁻²] - .. versionchanged:: 0.11.2 - Renamed from ``ghi_clearsky`` to ``ghi_clear``. + .. versionchanged:: 0.11.2 + Renamed from ``ghi_clearsky`` to ``ghi_clear``. dni_clear : array-like Direct normal irradiance from clear sky model. [Wm⁻²] From e2e4fbc2a51b33d8db020e6d1be5bdb3f1781ab1 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Mon, 16 Dec 2024 15:16:06 -0700 Subject: [PATCH 20/20] Update irradiance.py --- pvlib/irradiance.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 2534f2f81d..7fbb1ea985 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -1634,8 +1634,8 @@ def clearsky_index(ghi, ghi_clear, max_clearsky_index=2.0): ghi_clear : numeric Modeled clearsky GHI - .. versionchanged:: 0.11.2 - Renamed from ``ghi_clearsky`` to ``ghi_clear``. + .. versionchanged:: 0.11.2 + Renamed from ``ghi_clearsky`` to ``ghi_clear``. max_clearsky_index : numeric, default 2.0 Maximum value of the clearsky index. The default, 2.0, allows @@ -2191,14 +2191,14 @@ def dirindex(ghi, ghi_clear, dni_clear, zenith, times, pressure=101325., ghi_clear : array-like Global horizontal irradiance from clear sky model. [Wm⁻²] - .. versionchanged:: 0.11.2 - Renamed from ``ghi_clearsky`` to ``ghi_clear``. + .. versionchanged:: 0.11.2 + Renamed from ``ghi_clearsky`` to ``ghi_clear``. dni_clear : array-like Direct normal irradiance from clear sky model. [Wm⁻²] - .. versionchanged:: 0.11.2 - Renamed from ``dni_clearsky`` to ``dni_clear``. + .. versionchanged:: 0.11.2 + Renamed from ``dni_clearsky`` to ``dni_clear``. zenith : array-like True (not refraction-corrected) zenith angles in decimal