Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/irradiance-transposition/plot_rtranpose_year.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
)

Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions docs/sphinx/source/whatsnew/v0.15.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ 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 date. The old name will be removed in v0.17.0.
(:issue:`2774`, :pull:`2777`)


Bug fixes
Expand Down Expand Up @@ -62,3 +66,4 @@ Contributors
* Cliff Hansen (:ghuser:`cwhanse`)
* Arthur Onno (:ghuser:`ArthurOnnoTerabase`)
* Adam R. Jensen (:ghuser:`AdamRJensen`)
* Rajiv Daxini (:ghuser:`RDaxini`)
16 changes: 12 additions & 4 deletions pvlib/irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -1614,6 +1614,14 @@ def ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth,
return ghi


Comment thread
RDaxini marked this conversation as resolved.
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.
Expand Down
19 changes: 13 additions & 6 deletions tests/test_irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -828,19 +828,26 @@ 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\)"):
output = irradiance.ghi_from_poa_driesse_2023(
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)
# 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


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'])
Expand Down
Loading