-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Change g_poa_effective to effective_irradiance #2235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AdamRJensen
wants to merge
10
commits into
pvlib:main
Choose a base branch
from
AdamRJensen:remove_g_poa_effective
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+51
−12
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
bf6554a
Change g_poa_effective to effective_irradiance
AdamRJensen 271ffff
Update whatsnews and variable_style_rules
AdamRJensen d31ad0f
Update docs/sphinx/source/whatsnew/v0.11.2.rst
AdamRJensen 34752cf
Merge remote-tracking branch 'upstream/main' into remove_g_poa_effective
AdamRJensen 14fbe9d
Change whatsnew file
AdamRJensen 69f6c2b
Merge remote-tracking branch 'upstream/main' into remove_g_poa_effective
AdamRJensen b969039
Add deprecation warning
AdamRJensen 0f1dd29
Create v0.13.0.rst
AdamRJensen 22f71e7
Fix imports
AdamRJensen b1d1eff
Fix linter
AdamRJensen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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,24 +845,26 @@ 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']`, | ||||||||||||
and `self.module_parameters['gamma_pdc']`. | ||||||||||||
|
||||||||||||
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.): | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
What do you think about deprecating the parameter names with the decorator introduced in #2237? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's obviously a very good idea :) |
||||||||||||
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 | ||||||||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.