1616from pvlib import atmosphere , solarposition , tools
1717import pvlib # used to avoid dni name collision in complete_irradiance
1818
19- from pvlib ._deprecation import pvlibDeprecationWarning
19+ from pvlib ._deprecation import pvlibDeprecationWarning , deprecated
2020import warnings
2121
2222
@@ -132,7 +132,9 @@ def _handle_extra_radiation_types(datetime_or_doy, epoch_year):
132132 # a better way to do it.
133133 if isinstance (datetime_or_doy , pd .DatetimeIndex ):
134134 to_doy = tools ._pandas_to_doy # won't be evaluated unless necessary
135- def to_datetimeindex (x ): return x # noqa: E306
135+
136+ def to_datetimeindex (x ):
137+ return x # noqa: E306
136138 to_output = partial (pd .Series , index = datetime_or_doy )
137139 elif isinstance (datetime_or_doy , pd .Timestamp ):
138140 to_doy = tools ._pandas_to_doy
@@ -146,12 +148,14 @@ def to_datetimeindex(x): return x # noqa: E306
146148 tools ._datetimelike_scalar_to_datetimeindex
147149 to_output = tools ._scalar_out
148150 elif np .isscalar (datetime_or_doy ): # ints and floats of various types
149- def to_doy (x ): return x # noqa: E306
151+ def to_doy (x ):
152+ return x # noqa: E306
150153 to_datetimeindex = partial (tools ._doy_to_datetimeindex ,
151154 epoch_year = epoch_year )
152155 to_output = tools ._scalar_out
153156 else : # assume that we have an array-like object of doy
154- def to_doy (x ): return x # noqa: E306
157+ def to_doy (x ):
158+ return x # noqa: E306
155159 to_datetimeindex = partial (tools ._doy_to_datetimeindex ,
156160 epoch_year = epoch_year )
157161 to_output = tools ._array_out
@@ -1075,7 +1079,7 @@ def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
10751079 airmass : numeric
10761080 Relative (not pressure-corrected) airmass values. If AM is a
10771081 DataFrame it must be of the same size as all other DataFrame
1078- inputs. AM must be >=0 (careful using the 1/sec (z) model of AM
1082+ inputs. AM must be >=0 (careful using the 1/cos (z) model of AM
10791083 generation). [unitless]
10801084
10811085 model : string, default 'allsitescomposite1990'
@@ -1335,7 +1339,7 @@ def perez_driesse(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
13351339 airmass : numeric, optional
13361340 Relative (not pressure-corrected) airmass values. If ``airmass`` is a
13371341 DataFrame it must be of the same size as all other DataFrame
1338- inputs. AM must be >=0 (careful using the 1/sec (z) model of AM
1342+ inputs. AM must be >=0 (careful using the 1/cos (z) model of AM
13391343 generation). [unitless]
13401344
13411345 return_components: bool (optional, default=False)
@@ -1442,7 +1446,7 @@ def _poa_from_ghi(surface_tilt, surface_azimuth,
14421446 Transposition function that includes decomposition of GHI using the
14431447 continuous Erbs-Driesse model.
14441448
1445- Helper function for ghi_from_poa_driesse_2023 .
1449+ Helper function for ghi_from_poa_driesse_2024 .
14461450 '''
14471451 # Contributed by Anton Driesse (@adriesse), PV Performance Labs. Nov., 2023
14481452
@@ -1468,7 +1472,7 @@ def _ghi_from_poa(surface_tilt, surface_azimuth,
14681472 '''
14691473 Reverse transposition function that uses the scalar bisection from scipy.
14701474
1471- Helper function for ghi_from_poa_driesse_2023 .
1475+ Helper function for ghi_from_poa_driesse_2024 .
14721476 '''
14731477 # Contributed by Anton Driesse (@adriesse), PV Performance Labs. Nov., 2023
14741478
@@ -1512,7 +1516,7 @@ def poa_error(ghi):
15121516 return ghi , conv , niter
15131517
15141518
1515- def ghi_from_poa_driesse_2023 (surface_tilt , surface_azimuth ,
1519+ def ghi_from_poa_driesse_2024 (surface_tilt , surface_azimuth ,
15161520 solar_zenith , solar_azimuth ,
15171521 poa_global ,
15181522 dni_extra , airmass = None , albedo = 0.25 ,
@@ -1614,6 +1618,14 @@ def ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth,
16141618 return ghi
16151619
16161620
1621+ ghi_from_poa_driesse_2023 = deprecated (
1622+ since = "0.15.2" ,
1623+ name = "pvlib.irradiance.ghi_from_poa_driesse_2023" ,
1624+ alternative = "pvlib.irradiance.ghi_from_poa_driesse_2024" ,
1625+ removal = "0.17.0" ,
1626+ )(ghi_from_poa_driesse_2024 )
1627+
1628+
16171629def clearsky_index (ghi , ghi_clear , max_clearsky_index = 2.0 ):
16181630 """
16191631 Calculate the clearsky index.
@@ -1964,14 +1976,14 @@ def dirint(ghi, solar_zenith, times, pressure=101325., use_delta_kt_prime=True,
19641976
19651977 Returns
19661978 -------
1967- dni : array-like
1968- The modeled direct normal irradiance, as provided by the
1969- DIRINT model. [Wm⁻²]
1979+ dni : pd.Series
1980+ Estimated direct normal irradiance. [Wm⁻²]
19701981
19711982 Notes
19721983 -----
1973- DIRINT model requires time series data (ie. one of the inputs must
1974- be a vector of length > 2).
1984+ The DIRINT model was developed for time series data with length > 2.
1985+ The implementation in pvlib assumes the data are periodic which may
1986+ affect the first and last DNI values.
19751987
19761988 References
19771989 ----------
@@ -2109,6 +2121,7 @@ def _dirint_bins(times, kt_prime, zenith, w, delta_kt_prime):
21092121 -------
21102122 tuple of kt_prime_bin, zenith_bin, w_bin, delta_kt_prime_bin
21112123 """
2124+
21122125 # @wholmgren: the following bin assignments use MATLAB's 1-indexing.
21132126 # Later, we'll subtract 1 to conform to Python's 0-indexing.
21142127
0 commit comments