Skip to content

Commit fec2a77

Browse files
fuma900cwhanseRDaxini
authored
Use k and cap_adjustment from Array.module_parameters in PVSystem.pvwatts_dc (#2715)
* Update _build_kwargs call in PVSystem.pvwatts_dc to include 'k' and 'cap_adjustment' parameters * Add 'k' and 'cap_adjustment' parameters to module_parameters in pvwatts_system_kwargs fixture * Add enhancement entry in v0.15.1 release notes and add contributor * Update docstring in PVSystem.pvwatts_dc * Fix linting failure * Fix linting failure * Update docstring in PVSystem.pvwatts_dc Co-authored-by: Cliff Hansen <cwhanse@sandia.gov> * Apply suggestion from @RDaxini Co-authored-by: Rajiv Daxini <143435106+RDaxini@users.noreply.github.com> --------- Co-authored-by: Cliff Hansen <cwhanse@sandia.gov> Co-authored-by: Rajiv Daxini <143435106+RDaxini@users.noreply.github.com>
1 parent 9505a0a commit fec2a77

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ Bug fixes
2020

2121
Enhancements
2222
~~~~~~~~~~~~
23-
23+
* Use ``k`` and ``cap_adjustment`` from :py:func:`pvlib.pvsystem.Array.module_parameters` in :py:func:`pvlib.pvsystem.PVSystem.pvwatts_dc`
24+
(:issue:`2714`, :pull:`2715`)
25+
2426

2527
Documentation
2628
~~~~~~~~~~~~~
@@ -70,4 +72,5 @@ Contributors
7072
* Anton Driesse (:ghuser:`adriesse`)
7173
* Kevin Anderson (:ghuser:`kandersolar`)
7274
* Rohan Saxena (:ghuser:`r0hansaxena`)
75+
* Marco Fumagalli (:ghuser:`fuma900`)
7376

pvlib/pvsystem.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,10 @@ def pvwatts_dc(self, effective_irradiance, temp_cell):
850850
"""
851851
Calculates DC power according to the PVWatts model using
852852
:py:func:`pvlib.pvsystem.pvwatts_dc`, `self.module_parameters['pdc0']`,
853-
and `self.module_parameters['gamma_pdc']`.
853+
`self.module_parameters['gamma_pdc']`,
854+
`self.module_parameters['temp_ref']`, and optionally,
855+
`self.module_parameters['k']` and
856+
`self.module_parameters['cap_adjustment']`.
854857
855858
See :py:func:`pvlib.pvsystem.pvwatts_dc` for details.
856859
"""
@@ -860,7 +863,8 @@ def pvwatts_dc(self, effective_irradiance, temp_cell):
860863
pvwatts_dc(effective_irradiance, temp_cell,
861864
array.module_parameters['pdc0'],
862865
array.module_parameters['gamma_pdc'],
863-
**_build_kwargs(['temp_ref'], array.module_parameters))
866+
**_build_kwargs(['temp_ref', 'k', 'cap_adjustment'],
867+
array.module_parameters))
864868
for array, effective_irradiance, temp_cell
865869
in zip(self.arrays, effective_irradiance, temp_cell)
866870
)

tests/test_pvsystem.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2260,7 +2260,8 @@ def pvwatts_system_defaults():
22602260

22612261
@pytest.fixture
22622262
def pvwatts_system_kwargs():
2263-
module_parameters = {'pdc0': 100, 'gamma_pdc': -0.003, 'temp_ref': 20}
2263+
module_parameters = {'pdc0': 100, 'gamma_pdc': -0.003, 'temp_ref': 20,
2264+
'k': 0.01, 'cap_adjustment': True}
22642265
inverter_parameters = {'pdc0': 90, 'eta_inv_nom': 0.95, 'eta_inv_ref': 1.0}
22652266
system = pvsystem.PVSystem(module_parameters=module_parameters,
22662267
inverter_parameters=inverter_parameters)

0 commit comments

Comments
 (0)