From 76216dd44efe1699e485bb27c332538d25e23bc1 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Tue, 9 Jun 2026 09:50:51 -0500 Subject: [PATCH 1/7] Update irradiance.py --- pvlib/irradiance.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 5a4a76df25..c3bf365a84 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, deprecated import warnings @@ -1442,7 +1442,7 @@ def _poa_from_ghi(surface_tilt, surface_azimuth, Transposition function that includes decomposition of GHI using the continuous Erbs-Driesse model. - Helper function for ghi_from_poa_driesse_2023. + Helper function for ghi_from_poa_driesse_2024. ''' # Contributed by Anton Driesse (@adriesse), PV Performance Labs. Nov., 2023 @@ -1468,7 +1468,7 @@ def _ghi_from_poa(surface_tilt, surface_azimuth, ''' Reverse transposition function that uses the scalar bisection from scipy. - Helper function for ghi_from_poa_driesse_2023. + Helper function for ghi_from_poa_driesse_2024. ''' # Contributed by Anton Driesse (@adriesse), PV Performance Labs. Nov., 2023 @@ -1512,7 +1512,7 @@ def poa_error(ghi): return ghi, conv, niter -def ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth, +def ghi_from_poa_driesse_2024(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth, poa_global, dni_extra, airmass=None, albedo=0.25, @@ -1614,6 +1614,14 @@ def ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth, return ghi +ghi_from_poa_driesse_2023 = deprecated( + since="0.15.2", + name="pvlib.irradiance.ghi_from_poa_driesse_2023", + alternative="pvlib.irradiance.ghi_from_poa_driesse_2024", + removal="0.17.0", +)(ghi_from_poa_driesse_2024) + + def clearsky_index(ghi, ghi_clear, max_clearsky_index=2.0): """ Calculate the clearsky index. From 89c0443e0e7ba99738ba96d79cdab0c1addacb9c Mon Sep 17 00:00:00 2001 From: RDaxini Date: Tue, 9 Jun 2026 09:55:03 -0500 Subject: [PATCH 2/7] Update test_irradiance.py --- tests/test_irradiance.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_irradiance.py b/tests/test_irradiance.py index a416636ae9..01786ffdc8 100644 --- a/tests/test_irradiance.py +++ b/tests/test_irradiance.py @@ -792,7 +792,7 @@ def test_ghi_from_poa_driesse(mocker): surface_azimuth = 180 # test core function - output = irradiance.ghi_from_poa_driesse_2023( + output = irradiance.ghi_from_poa_driesse_2024( surface_tilt, surface_azimuth, zenith, azimuth, poa_global, dni_extra=1366.1) @@ -802,7 +802,7 @@ def test_ghi_from_poa_driesse(mocker): # test series output poa_global = pd.Series([20, 300, 1000], index=times) - output = irradiance.ghi_from_poa_driesse_2023( + output = irradiance.ghi_from_poa_driesse_2024( surface_tilt, surface_azimuth, zenith, azimuth, poa_global, dni_extra=1366.1) @@ -811,7 +811,7 @@ def test_ghi_from_poa_driesse(mocker): # test full_output option and special cases poa_global = np.array([0, 1500, np.nan]) - ghi, conv, niter = irradiance.ghi_from_poa_driesse_2023( + ghi, conv, niter = irradiance.ghi_from_poa_driesse_2024( surface_tilt, surface_azimuth, zenith, azimuth, poa_global, dni_extra=1366.1, full_output=True) @@ -829,13 +829,13 @@ def test_ghi_from_poa_driesse(mocker): # test exception xtol = -3.14159 # negative value raises exception in scipy.optimize.bisect with pytest.raises(ValueError, match=rf"xtol too small \({xtol:g} <= 0\)"): - output = irradiance.ghi_from_poa_driesse_2023( + output = irradiance.ghi_from_poa_driesse_2024( surface_tilt, surface_azimuth, zenith, azimuth, poa_global, dni_extra=1366.1, xtol=xtol) # test propagation xtol = 3.141592 bisect_spy = mocker.spy(irradiance, "bisect") - output = irradiance.ghi_from_poa_driesse_2023( + output = irradiance.ghi_from_poa_driesse_2024( surface_tilt, surface_azimuth, zenith, azimuth, poa_global, dni_extra=1366.1, xtol=xtol) assert bisect_spy.call_args[1]["xtol"] == xtol From 159be1a2bb2b78e8a91fa428453e33bc87427ba9 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Tue, 9 Jun 2026 09:58:39 -0500 Subject: [PATCH 3/7] update sphinx refs, examples --- .../plot_rtranpose_limitations.py | 8 ++++---- .../irradiance-transposition/plot_rtranpose_year.py | 6 +++--- .../source/reference/irradiance/reverse-transposition.rst | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/examples/irradiance-transposition/plot_rtranpose_limitations.py b/docs/examples/irradiance-transposition/plot_rtranpose_limitations.py index 8df8339ad4..fca9557db2 100644 --- a/docs/examples/irradiance-transposition/plot_rtranpose_limitations.py +++ b/docs/examples/irradiance-transposition/plot_rtranpose_limitations.py @@ -28,7 +28,7 @@ # # In this example we look at a single point in time and consider a full range # of possible GHI and POA global values as shown in figures 3 and 4 of [1]_. -# Then we use :py:meth:`pvlib.irradiance.ghi_from_poa_driesse_2023` to estimate +# Then we use :py:meth:`pvlib.irradiance.ghi_from_poa_driesse_2024` to estimate # the original GHI from POA global. # # References @@ -45,7 +45,7 @@ from pvlib.irradiance import (erbs_driesse, get_total_irradiance, - ghi_from_poa_driesse_2023, + ghi_from_poa_driesse_2024, ) matplotlib.rcParams['axes.grid'] = True @@ -92,7 +92,7 @@ poa_test = 200 -ghi_hat = ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth, +ghi_hat = ghi_from_poa_driesse_2024(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth, poa_test, dni_extra, @@ -156,7 +156,7 @@ # out, other times not. # -result = ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth, +result = ghi_from_poa_driesse_2024(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth, poa_global, dni_extra, diff --git a/docs/examples/irradiance-transposition/plot_rtranpose_year.py b/docs/examples/irradiance-transposition/plot_rtranpose_year.py index c0b9860bba..b373ef1a25 100644 --- a/docs/examples/irradiance-transposition/plot_rtranpose_year.py +++ b/docs/examples/irradiance-transposition/plot_rtranpose_year.py @@ -21,7 +21,7 @@ # Recovering GHI from POA irradiance is termed "reverse transposition." # # In this example we start with a TMY file and calculate POA global irradiance. -# Then we use :py:meth:`pvlib.irradiance.ghi_from_poa_driesse_2023` to estimate +# Then we use :py:meth:`pvlib.irradiance.ghi_from_poa_driesse_2024` to estimate # the original GHI from POA global. Details of the method found in [1]_. # # Another method for reverse tranposition called GTI-DIRINT is also @@ -49,7 +49,7 @@ from pvlib import iotools, location from pvlib.irradiance import (get_extra_radiation, get_total_irradiance, - ghi_from_poa_driesse_2023, + ghi_from_poa_driesse_2024, aoi, ) @@ -114,7 +114,7 @@ start = time.process_time() -df['ghi_rev'] = ghi_from_poa_driesse_2023(TILT, ORIENT, +df['ghi_rev'] = ghi_from_poa_driesse_2024(TILT, ORIENT, solpos.apparent_zenith, solpos.azimuth, df.poa_global, diff --git a/docs/sphinx/source/reference/irradiance/reverse-transposition.rst b/docs/sphinx/source/reference/irradiance/reverse-transposition.rst index 31ce27bedd..55e1d40e36 100644 --- a/docs/sphinx/source/reference/irradiance/reverse-transposition.rst +++ b/docs/sphinx/source/reference/irradiance/reverse-transposition.rst @@ -6,5 +6,5 @@ Reverse transposition models .. autosummary:: :toctree: ../generated/ - irradiance.ghi_from_poa_driesse_2023 + irradiance.ghi_from_poa_driesse_2024 irradiance.gti_dirint From 5cc439fc14527474a12e51c395e83eaeedd6c68e Mon Sep 17 00:00:00 2001 From: RDaxini Date: Tue, 9 Jun 2026 10:10:34 -0500 Subject: [PATCH 4/7] Update v0.15.2.rst --- docs/sphinx/source/whatsnew/v0.15.2.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/sphinx/source/whatsnew/v0.15.2.rst b/docs/sphinx/source/whatsnew/v0.15.2.rst index 1f4524d893..e52fc0d4a1 100644 --- a/docs/sphinx/source/whatsnew/v0.15.2.rst +++ b/docs/sphinx/source/whatsnew/v0.15.2.rst @@ -10,6 +10,11 @@ Breaking Changes Deprecations ~~~~~~~~~~~~ +* Rename :py:func:`~pvlib.irradiance.ghi_from_poa_driesse_2023` to + :py:func:`~pvlib.irradiance.ghi_from_poa_driesse_2024`. The year now reflects + the publication data. The old name will be removed in v0.17.0. + (:issue:`2774`, :pull:`2777`) + Bug fixes @@ -62,3 +67,4 @@ Contributors * Cliff Hansen (:ghuser:`cwhanse`) * Arthur Onno (:ghuser:`ArthurOnnoTerabase`) * Adam R. Jensen (:ghuser:`AdamRJensen`) +* Rajiv Daxini (:ghuser:`RDaxini`) From 6ebfb57ad42607f90accf1223a421b35bae1a650 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Tue, 9 Jun 2026 10:10:46 -0500 Subject: [PATCH 5/7] flake8 --- tests/test_irradiance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_irradiance.py b/tests/test_irradiance.py index 01786ffdc8..40082e62c8 100644 --- a/tests/test_irradiance.py +++ b/tests/test_irradiance.py @@ -828,7 +828,7 @@ def test_ghi_from_poa_driesse(mocker): poa_global = pd.Series([20, 300, 1000], index=times) # test exception xtol = -3.14159 # negative value raises exception in scipy.optimize.bisect - with pytest.raises(ValueError, match=rf"xtol too small \({xtol:g} <= 0\)"): + with pytest.raises(ValueError, match=rf"xtol too small \({xtol} <= 0\)"): output = irradiance.ghi_from_poa_driesse_2024( surface_tilt, surface_azimuth, zenith, azimuth, poa_global, dni_extra=1366.1, xtol=xtol) From 871e8b4ed53a98afb2045de832b22b072defe7dc Mon Sep 17 00:00:00 2001 From: RDaxini Date: Tue, 9 Jun 2026 10:53:45 -0500 Subject: [PATCH 6/7] test deprecation --- tests/test_irradiance.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_irradiance.py b/tests/test_irradiance.py index 40082e62c8..9925d99902 100644 --- a/tests/test_irradiance.py +++ b/tests/test_irradiance.py @@ -841,6 +841,13 @@ def test_ghi_from_poa_driesse(mocker): assert bisect_spy.call_args[1]["xtol"] == xtol +def test_ghi_from_poa_driesse_2023_deprecated(): + with pytest.warns(pvlibDeprecationWarning, + match="ghi_from_poa_driesse_2024"): + irradiance.ghi_from_poa_driesse_2023( + 30, 180, 20, 180, 500, dni_extra=1366.1) + + def test_gti_dirint(): times = pd.DatetimeIndex( ['2014-06-24T06-0700', '2014-06-24T09-0700', '2014-06-24T12-0700']) From eeecf1ed351bc6ca143689c973d2aa9fd4303b97 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Tue, 9 Jun 2026 17:17:17 -0500 Subject: [PATCH 7/7] Update v0.15.2.rst --- docs/sphinx/source/whatsnew/v0.15.2.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.15.2.rst b/docs/sphinx/source/whatsnew/v0.15.2.rst index e52fc0d4a1..eab5a3fdb7 100644 --- a/docs/sphinx/source/whatsnew/v0.15.2.rst +++ b/docs/sphinx/source/whatsnew/v0.15.2.rst @@ -10,13 +10,12 @@ Breaking Changes Deprecations ~~~~~~~~~~~~ -* Rename :py:func:`~pvlib.irradiance.ghi_from_poa_driesse_2023` to +* Rename :py:func:`!pvlib.irradiance.ghi_from_poa_driesse_2023` to :py:func:`~pvlib.irradiance.ghi_from_poa_driesse_2024`. The year now reflects - the publication data. The old name will be removed in v0.17.0. + the publication date. The old name will be removed in v0.17.0. (:issue:`2774`, :pull:`2777`) - Bug fixes ~~~~~~~~~ * Corrects a bug in :py:func:`pvlib.temperature.fuentes`. If inputs were