1616from pvlib import atmosphere , solarposition , tools
1717import pvlib # used to avoid dni name collision in complete_irradiance
1818
19- from pvlib ._deprecation import deprecated , 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
@@ -1448,7 +1452,7 @@ def _poa_from_ghi(surface_tilt, surface_azimuth,
14481452 Transposition function that includes decomposition of GHI using the
14491453 continuous Erbs-Driesse model.
14501454
1451- Helper function for ghi_from_poa_driesse_2023 .
1455+ Helper function for ghi_from_poa_driesse_2024 .
14521456 '''
14531457 # Contributed by Anton Driesse (@adriesse), PV Performance Labs. Nov., 2023
14541458
@@ -1474,7 +1478,7 @@ def _ghi_from_poa(surface_tilt, surface_azimuth,
14741478 '''
14751479 Reverse transposition function that uses the scalar bisection from scipy.
14761480
1477- Helper function for ghi_from_poa_driesse_2023 .
1481+ Helper function for ghi_from_poa_driesse_2024 .
14781482 '''
14791483 # Contributed by Anton Driesse (@adriesse), PV Performance Labs. Nov., 2023
14801484
@@ -1518,7 +1522,7 @@ def poa_error(ghi):
15181522 return ghi , conv , niter
15191523
15201524
1521- def ghi_from_poa_driesse_2023 (surface_tilt , surface_azimuth ,
1525+ def ghi_from_poa_driesse_2024 (surface_tilt , surface_azimuth ,
15221526 solar_zenith , solar_azimuth ,
15231527 poa_global ,
15241528 dni_extra , airmass = None , albedo = 0.25 ,
@@ -1620,6 +1624,14 @@ def ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth,
16201624 return ghi
16211625
16221626
1627+ ghi_from_poa_driesse_2023 = deprecated (
1628+ since = "0.15.2" ,
1629+ name = "pvlib.irradiance.ghi_from_poa_driesse_2023" ,
1630+ alternative = "pvlib.irradiance.ghi_from_poa_driesse_2024" ,
1631+ removal = "0.17.0" ,
1632+ )(ghi_from_poa_driesse_2024 )
1633+
1634+
16231635def clearsky_index (ghi , ghi_clear , max_clearsky_index = 2.0 ):
16241636 """
16251637 Calculate the clearsky index.
@@ -1970,14 +1982,14 @@ def dirint(ghi, solar_zenith, times, pressure=101325., use_delta_kt_prime=True,
19701982
19711983 Returns
19721984 -------
1973- dni : array-like
1974- The modeled direct normal irradiance, as provided by the
1975- DIRINT model. [Wm⁻²]
1985+ dni : pd.Series
1986+ Estimated direct normal irradiance. [Wm⁻²]
19761987
19771988 Notes
19781989 -----
1979- DIRINT model requires time series data (ie. one of the inputs must
1980- be a vector of length > 2).
1990+ The DIRINT model was developed for time series data with length > 2.
1991+ The implementation in pvlib assumes the data are periodic which may
1992+ affect the first and last DNI values.
19811993
19821994 References
19831995 ----------
@@ -2115,6 +2127,7 @@ def _dirint_bins(times, kt_prime, zenith, w, delta_kt_prime):
21152127 -------
21162128 tuple of kt_prime_bin, zenith_bin, w_bin, delta_kt_prime_bin
21172129 """
2130+
21182131 # @wholmgren: the following bin assignments use MATLAB's 1-indexing.
21192132 # Later, we'll subtract 1 to conform to Python's 0-indexing.
21202133
0 commit comments