Skip to content

Commit 3bc67a2

Browse files
AdamRJensenRDaxinikandersolar
authored
Change g_poa_effective to effective_irradiance (#2235)
* Change g_poa_effective to effective_irradiance * Update whatsnews and variable_style_rules * Update docs/sphinx/source/whatsnew/v0.11.2.rst Co-authored-by: RDaxini <143435106+RDaxini@users.noreply.github.com> * Change whatsnew file * Add deprecation warning * Create v0.13.0.rst * Fix imports * Fix linter * Update whatsnews * Remove removal year Co-authored-by: Kevin Anderson <kevin.anderso@gmail.com> * Update plot_agrivoltaics_ground_irradiance.py --------- Co-authored-by: RDaxini <143435106+RDaxini@users.noreply.github.com> Co-authored-by: Kevin Anderson <kevin.anderso@gmail.com>
1 parent 15d0911 commit 3bc67a2

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

docs/examples/agrivoltaics/plot_agrivoltaics_ground_irradiance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
)
117117

118118
power_dc = pvlib.pvsystem.pvwatts_dc(
119-
g_poa_effective=irradiance['poa_global'],
119+
effective_irradiance=irradiance['poa_global'],
120120
temp_cell=temp_cell,
121121
pdc0=pdc0,
122122
gamma_pdc=gamma_pdc)

docs/sphinx/source/user_guide/modeling_topics/pvsystem.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ data irradiance and temperature.
7575

7676
.. ipython:: python
7777
78-
pdc = system.pvwatts_dc(g_poa_effective=1000, temp_cell=30)
78+
pdc = system.pvwatts_dc(effective_irradiance=1000, temp_cell=30)
7979
print(pdc)
8080
8181
Methods attached to a PVSystem object wrap the corresponding functions in
@@ -84,8 +84,8 @@ using data stored in the PVSystem attributes. Compare the
8484
:py:meth:`~pvlib.pvsystem.PVSystem.pvwatts_dc` method signature to the
8585
:py:func:`~pvlib.pvsystem.pvwatts_dc` function signature:
8686

87-
* :py:meth:`PVSystem.pvwatts_dc(g_poa_effective, temp_cell) <pvlib.pvsystem.PVSystem.pvwatts_dc>`
88-
* :py:func:`pvwatts_dc(g_poa_effective, temp_cell, pdc0, gamma_pdc, temp_ref=25.) <pvlib.pvsystem.pvwatts_dc>`
87+
* :py:meth:`PVSystem.pvwatts_dc(effective_irradiance, temp_cell) <pvlib.pvsystem.PVSystem.pvwatts_dc>`
88+
* :py:func:`pvwatts_dc(effective_irradiance, temp_cell, pdc0, gamma_pdc, temp_ref=25.) <pvlib.pvsystem.pvwatts_dc>`
8989

9090
How does this work? The :py:meth:`~pvlib.pvsystem.PVSystem.pvwatts_dc`
9191
method looks in `PVSystem.module_parameters` for the `pdc0`, and

docs/sphinx/source/whatsnew/v0.12.1.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ Deprecations
2626
* The ``server`` parameter in :py:func:`~pvlib.iotools.get_cams` has been renamed
2727
to ``url`` to be consistent with the other iotools.
2828
:pull:`2463`
29-
29+
* Rename parameter name ``g_poa_effective`` to ``effective_irradiance`` in
30+
:py:func:`~pvlib.pvsystem.PVSystem.pvwatts_dc` and :py:func:`~pvlib.pvsystem.pvwatts_dc`.
31+
(:issue:`1253`, :pull:`2235`)
3032

3133
Bug fixes
3234
~~~~~~~~~

pvlib/pvsystem.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from dataclasses import dataclass
1717
from abc import ABC, abstractmethod
1818
from typing import Optional, Union
19-
19+
from pvlib._deprecation import renamed_kwarg_warning
2020
import pvlib # used to avoid albedo name collision in the Array class
2121
from pvlib import (atmosphere, iam, inverter, irradiance,
2222
singlediode as _singlediode, spectrum, temperature)
@@ -843,24 +843,26 @@ def scale_voltage_current_power(self, data):
843843
for array, data in zip(self.arrays, data)
844844
)
845845

846+
@renamed_kwarg_warning(
847+
"0.13.0", "g_poa_effective", "effective_irradiance")
846848
@_unwrap_single_value
847-
def pvwatts_dc(self, g_poa_effective, temp_cell):
849+
def pvwatts_dc(self, effective_irradiance, temp_cell):
848850
"""
849851
Calculates DC power according to the PVWatts model using
850852
:py:func:`pvlib.pvsystem.pvwatts_dc`, `self.module_parameters['pdc0']`,
851853
and `self.module_parameters['gamma_pdc']`.
852854
853855
See :py:func:`pvlib.pvsystem.pvwatts_dc` for details.
854856
"""
855-
g_poa_effective = self._validate_per_array(g_poa_effective)
857+
effective_irradiance = self._validate_per_array(effective_irradiance)
856858
temp_cell = self._validate_per_array(temp_cell)
857859
return tuple(
858-
pvwatts_dc(g_poa_effective, temp_cell,
860+
pvwatts_dc(effective_irradiance, temp_cell,
859861
array.module_parameters['pdc0'],
860862
array.module_parameters['gamma_pdc'],
861863
**_build_kwargs(['temp_ref'], array.module_parameters))
862-
for array, g_poa_effective, temp_cell
863-
in zip(self.arrays, g_poa_effective, temp_cell)
864+
for array, effective_irradiance, temp_cell
865+
in zip(self.arrays, effective_irradiance, temp_cell)
864866
)
865867

866868
def pvwatts_losses(self):
@@ -2856,7 +2858,9 @@ def scale_voltage_current_power(data, voltage=1, current=1):
28562858
return df_sorted
28572859

28582860

2859-
def pvwatts_dc(g_poa_effective, temp_cell, pdc0, gamma_pdc, temp_ref=25.):
2861+
@renamed_kwarg_warning(
2862+
"0.13.0", "g_poa_effective", "effective_irradiance")
2863+
def pvwatts_dc(effective_irradiance, temp_cell, pdc0, gamma_pdc, temp_ref=25.):
28602864
r"""
28612865
Implements NREL's PVWatts DC power model. The PVWatts DC model [1]_ is:
28622866
@@ -2872,7 +2876,7 @@ def pvwatts_dc(g_poa_effective, temp_cell, pdc0, gamma_pdc, temp_ref=25.):
28722876
28732877
Parameters
28742878
----------
2875-
g_poa_effective: numeric
2879+
effective_irradiance: numeric
28762880
Irradiance transmitted to the PV cells. To be
28772881
fully consistent with PVWatts, the user must have already
28782882
applied angle of incidence losses, but not soiling, spectral,
@@ -2900,7 +2904,7 @@ def pvwatts_dc(g_poa_effective, temp_cell, pdc0, gamma_pdc, temp_ref=25.):
29002904
(2014).
29012905
""" # noqa: E501
29022906

2903-
pdc = (g_poa_effective * 0.001 * pdc0 *
2907+
pdc = (effective_irradiance * 0.001 * pdc0 *
29042908
(1 + gamma_pdc * (temp_cell - temp_ref)))
29052909

29062910
return pdc

0 commit comments

Comments
 (0)