diff --git a/docs/sphinx/source/user_guide/pvsystem.rst b/docs/sphinx/source/user_guide/pvsystem.rst index c3d666fbfe..9cadb72107 100644 --- a/docs/sphinx/source/user_guide/pvsystem.rst +++ b/docs/sphinx/source/user_guide/pvsystem.rst @@ -75,7 +75,7 @@ data irradiance and temperature. .. ipython:: python - pdc = system.pvwatts_dc(g_poa_effective=1000, temp_cell=30) + pdc = system.pvwatts_dc(effective_irradiance=1000, temp_cell=30) print(pdc) Methods attached to a PVSystem object wrap the corresponding functions in @@ -84,8 +84,8 @@ using data stored in the PVSystem attributes. Compare the :py:meth:`~pvlib.pvsystem.PVSystem.pvwatts_dc` method signature to the :py:func:`~pvlib.pvsystem.pvwatts_dc` function signature: - * :py:meth:`PVSystem.pvwatts_dc(g_poa_effective, temp_cell) ` - * :py:func:`pvwatts_dc(g_poa_effective, temp_cell, pdc0, gamma_pdc, temp_ref=25.) ` + * :py:meth:`PVSystem.pvwatts_dc(effective_irradiance, temp_cell) ` + * :py:func:`pvwatts_dc(effective_irradiance, temp_cell, pdc0, gamma_pdc, temp_ref=25.) ` How does this work? The :py:meth:`~pvlib.pvsystem.PVSystem.pvwatts_dc` method looks in `PVSystem.module_parameters` for the `pdc0`, and diff --git a/docs/sphinx/source/whatsnew/v0.13.0.rst b/docs/sphinx/source/whatsnew/v0.13.0.rst new file mode 100644 index 0000000000..513c2be236 --- /dev/null +++ b/docs/sphinx/source/whatsnew/v0.13.0.rst @@ -0,0 +1,35 @@ +.. _whatsnew_01300: + + +v0.13.0 (September XX, 2025) +------------------------ + +Breaking Changes +~~~~~~~~~~~~~~~~ +* Rename parameter name ``g_poa_effective`` to ``effective_irradiance`` in + :py:func:`~pvlib.pvsystem.PVSystem.pvwatts_dc` and :py:func:`~pvlib.pvsystem.pvwatts_dc`. + (:issue:`1253`, :pull:`2235`) + +Bug fixes +~~~~~~~~~ + + +Enhancements +~~~~~~~~~~~~ + + +Documentation +~~~~~~~~~~~~~ + + +Testing +~~~~~~~ + + +Maintenance +~~~~~~~~~~~ + + +Contributors +~~~~~~~~~~~~ +* Adam R. Jensen (:ghuser:`AdamRJensen`) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index b762372ae7..bcdee8dedc 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -17,7 +17,7 @@ from abc import ABC, abstractmethod from typing import Optional, Union -from pvlib._deprecation import deprecated +from pvlib._deprecation import renamed_kwarg_warning import pvlib # used to avoid albedo name collision in the Array class from pvlib import (atmosphere, iam, inverter, irradiance, @@ -845,8 +845,10 @@ def scale_voltage_current_power(self, data): for array, data in zip(self.arrays, data) ) + @renamed_kwarg_warning( + "0.13.0", "g_poa_effective", "effective_irradiance", "0.14.0") @_unwrap_single_value - def pvwatts_dc(self, g_poa_effective, temp_cell): + def pvwatts_dc(self, effective_irradiance, temp_cell): """ Calculates DC power according to the PVWatts model using :py:func:`pvlib.pvsystem.pvwatts_dc`, `self.module_parameters['pdc0']`, @@ -854,15 +856,15 @@ def pvwatts_dc(self, g_poa_effective, temp_cell): See :py:func:`pvlib.pvsystem.pvwatts_dc` for details. """ - g_poa_effective = self._validate_per_array(g_poa_effective) + effective_irradiance = self._validate_per_array(effective_irradiance) temp_cell = self._validate_per_array(temp_cell) return tuple( - pvwatts_dc(g_poa_effective, temp_cell, + pvwatts_dc(effective_irradiance, temp_cell, array.module_parameters['pdc0'], array.module_parameters['gamma_pdc'], **_build_kwargs(['temp_ref'], array.module_parameters)) - for array, g_poa_effective, temp_cell - in zip(self.arrays, g_poa_effective, temp_cell) + for array, effective_irradiance, temp_cell + in zip(self.arrays, effective_irradiance, temp_cell) ) def pvwatts_losses(self): @@ -2799,7 +2801,9 @@ def scale_voltage_current_power(data, voltage=1, current=1): return df_sorted -def pvwatts_dc(g_poa_effective, temp_cell, pdc0, gamma_pdc, temp_ref=25.): +@renamed_kwarg_warning( + "0.12.0", "g_poa_effective", "effective_irradiance", "0.13.0") +def pvwatts_dc(effective_irradiance, temp_cell, pdc0, gamma_pdc, temp_ref=25.): r""" Implements NREL's PVWatts DC power model. The PVWatts DC model [1]_ is: @@ -2815,7 +2819,7 @@ def pvwatts_dc(g_poa_effective, temp_cell, pdc0, gamma_pdc, temp_ref=25.): Parameters ---------- - g_poa_effective: numeric + effective_irradiance: numeric Irradiance transmitted to the PV cells. To be fully consistent with PVWatts, the user must have already applied angle of incidence losses, but not soiling, spectral, @@ -2843,7 +2847,7 @@ def pvwatts_dc(g_poa_effective, temp_cell, pdc0, gamma_pdc, temp_ref=25.): (2014). """ # noqa: E501 - pdc = (g_poa_effective * 0.001 * pdc0 * + pdc = (effective_irradiance * 0.001 * pdc0 * (1 + gamma_pdc * (temp_cell - temp_ref))) return pdc