From bf6554aba532aac3ae247c0622400b322cd8f203 Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Sun, 29 Sep 2024 22:49:50 +0200 Subject: [PATCH 1/8] Change g_poa_effective to effective_irradiance --- docs/sphinx/source/user_guide/pvsystem.rst | 6 +++--- docs/sphinx/source/whatsnew/v0.11.2.rst | 2 ++ pvlib/pvsystem.py | 16 ++++++++-------- 3 files changed, 13 insertions(+), 11 deletions(-) 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.11.2.rst b/docs/sphinx/source/whatsnew/v0.11.2.rst index 9d7129d50d..93c0143431 100644 --- a/docs/sphinx/source/whatsnew/v0.11.2.rst +++ b/docs/sphinx/source/whatsnew/v0.11.2.rst @@ -6,6 +6,8 @@ v0.11.2 (Anticipated December, 2024) Deprecations ~~~~~~~~~~~~ +* Changed the `g_poa_effective` parameter name to + `effective_irradiance` in :py:func:`~pvlib.pvsystem.PVSystem.pvwatts_dc`. Enhancements diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index 57752dff7e..a95128ff4b 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -839,7 +839,7 @@ def scale_voltage_current_power(self, data): ) @_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']`, @@ -847,15 +847,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): @@ -2764,7 +2764,7 @@ 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.): +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: @@ -2780,7 +2780,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, @@ -2808,7 +2808,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 From 271ffff0f745407bfa81d39a4e9478f350923a00 Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Sun, 29 Sep 2024 22:54:24 +0200 Subject: [PATCH 2/8] Update whatsnews and variable_style_rules --- docs/sphinx/source/whatsnew/v0.11.2.rst | 2 +- pvlib/data/variables_style_rules.csv | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.11.2.rst b/docs/sphinx/source/whatsnew/v0.11.2.rst index 93c0143431..626c7013f9 100644 --- a/docs/sphinx/source/whatsnew/v0.11.2.rst +++ b/docs/sphinx/source/whatsnew/v0.11.2.rst @@ -8,7 +8,7 @@ Deprecations ~~~~~~~~~~~~ * Changed the `g_poa_effective` parameter name to `effective_irradiance` in :py:func:`~pvlib.pvsystem.PVSystem.pvwatts_dc`. - + (:pull:`2235`) Enhancements ~~~~~~~~~~~~ diff --git a/pvlib/data/variables_style_rules.csv b/pvlib/data/variables_style_rules.csv index 1954e036c2..721c15aa16 100644 --- a/pvlib/data/variables_style_rules.csv +++ b/pvlib/data/variables_style_rules.csv @@ -21,7 +21,6 @@ poa_direct;direct/beam irradiation in plane poa_diffuse;total diffuse irradiation in plane. sum of ground and sky diffuse. poa_global;global irradiation in plane. sum of diffuse and beam projection. poa_sky_diffuse;diffuse irradiation in plane from scattered light in the atmosphere (without ground reflected irradiation) -g_poa_effective;broadband plane of array effective irradiance. surface_tilt;tilt angle of the surface surface_azimuth;azimuth angle of the surface solar_zenith;zenith angle of the sun in degrees From d31ad0fe962df9675965418a0f2c5ca90335ed03 Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Mon, 30 Sep 2024 00:02:20 +0200 Subject: [PATCH 3/8] Update docs/sphinx/source/whatsnew/v0.11.2.rst Co-authored-by: RDaxini <143435106+RDaxini@users.noreply.github.com> --- docs/sphinx/source/whatsnew/v0.11.2.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.11.2.rst b/docs/sphinx/source/whatsnew/v0.11.2.rst index 626c7013f9..606645319b 100644 --- a/docs/sphinx/source/whatsnew/v0.11.2.rst +++ b/docs/sphinx/source/whatsnew/v0.11.2.rst @@ -8,7 +8,7 @@ Deprecations ~~~~~~~~~~~~ * Changed the `g_poa_effective` parameter name to `effective_irradiance` in :py:func:`~pvlib.pvsystem.PVSystem.pvwatts_dc`. - (:pull:`2235`) + (:issue:`1253`, :pull:`2235`) Enhancements ~~~~~~~~~~~~ From 14fbe9d13dea73efa41a94819d0569b14f11068f Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Fri, 14 Mar 2025 22:03:44 +0100 Subject: [PATCH 4/8] Change whatsnew file --- docs/sphinx/source/whatsnew/v0.11.2.rst | 3 --- docs/sphinx/source/whatsnew/v0.11.3.rst | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.11.2.rst b/docs/sphinx/source/whatsnew/v0.11.2.rst index d21a071058..ab63431e0d 100644 --- a/docs/sphinx/source/whatsnew/v0.11.2.rst +++ b/docs/sphinx/source/whatsnew/v0.11.2.rst @@ -6,9 +6,6 @@ v0.11.2 (December 16, 2024) Deprecations ~~~~~~~~~~~~ -* Changed the `g_poa_effective` parameter name to - `effective_irradiance` in :py:func:`~pvlib.pvsystem.PVSystem.pvwatts_dc`. - (:issue:`1253`, :pull:`2235`) * Deprecate terms ``dni_clearsky`` and ``clearsky_dni``, replace with ``dni_clear`` and ``ghi_clear``. Affected functions are :py:func:`~pvlib.irradiance.dirindex`, :py:func:`~pvlib.irradiance.dni` and :py:func:`~pvlib.irradiance.clearsky_index`. diff --git a/docs/sphinx/source/whatsnew/v0.11.3.rst b/docs/sphinx/source/whatsnew/v0.11.3.rst index 829b86dea5..99dcd9a395 100644 --- a/docs/sphinx/source/whatsnew/v0.11.3.rst +++ b/docs/sphinx/source/whatsnew/v0.11.3.rst @@ -41,6 +41,10 @@ Bug fixes returns an IANA string. (:issue:`2340`, :pull:`2341`) * :py:func:`~pvlib.iotools.get_pvgis_tmy` with ``outputformat='csv'`` now works with the updated data format returned by PVGIS. (:issue:`2344`, :pull:`2395`) +* Changed the `g_poa_effective` parameter name to + `effective_irradiance` in :py:func:`~pvlib.pvsystem.PVSystem.pvwatts_dc`. + (:issue:`1253`, :pull:`2235`) + Deprecations ~~~~~~~~~~~~ From b969039d07ef978a965a0a7987c3154339b54d0b Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Thu, 20 Mar 2025 23:55:25 +0100 Subject: [PATCH 5/8] Add deprecation warning --- pvlib/pvsystem.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index 04b07e000a..53325536c7 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -845,6 +845,8 @@ 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, effective_irradiance, temp_cell): """ @@ -2799,6 +2801,8 @@ def scale_voltage_current_power(data, voltage=1, current=1): return df_sorted +from pvlib._deprecation import renamed_kwarg_warning +@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: From 0f1dd29c974720640c6505857a140ce8ae7db116 Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Thu, 20 Mar 2025 23:55:30 +0100 Subject: [PATCH 6/8] Create v0.13.0.rst --- docs/sphinx/source/whatsnew/v0.13.0.rst | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 docs/sphinx/source/whatsnew/v0.13.0.rst 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`) From 22f71e785ec204118a527f8de6c7072d85f17d4c Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Fri, 21 Mar 2025 00:01:02 +0100 Subject: [PATCH 7/8] Fix imports --- pvlib/pvsystem.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index 53325536c7..296a8d32b9 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, @@ -2801,7 +2801,6 @@ def scale_voltage_current_power(data, voltage=1, current=1): return df_sorted -from pvlib._deprecation import renamed_kwarg_warning @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""" From b1d1effff6bf1a18873c09949a3f5a74a743fb48 Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Fri, 21 Mar 2025 00:08:22 +0100 Subject: [PATCH 8/8] Fix linter --- pvlib/pvsystem.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index 296a8d32b9..bcdee8dedc 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -845,8 +845,8 @@ 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") + @renamed_kwarg_warning( + "0.13.0", "g_poa_effective", "effective_irradiance", "0.14.0") @_unwrap_single_value def pvwatts_dc(self, effective_irradiance, temp_cell): """ @@ -2801,7 +2801,8 @@ def scale_voltage_current_power(data, voltage=1, current=1): return df_sorted -@renamed_kwarg_warning("0.12.0", "g_poa_effective", "effective_irradiance", "0.13.0") +@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: