From c29129df31c18ab1e484fb148bb00f4899f7af26 Mon Sep 17 00:00:00 2001 From: Marco Fumagalli <2473326+fuma900@users.noreply.github.com> Date: Wed, 11 Mar 2026 09:15:58 +0000 Subject: [PATCH 1/8] Update _build_kwargs call in PVSystem.pvwatts_dc to include 'k' and 'cap_adjustment' parameters --- pvlib/pvsystem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index fe85359b99..c2c6a9d3cc 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -860,7 +860,7 @@ def pvwatts_dc(self, effective_irradiance, temp_cell): pvwatts_dc(effective_irradiance, temp_cell, array.module_parameters['pdc0'], array.module_parameters['gamma_pdc'], - **_build_kwargs(['temp_ref'], array.module_parameters)) + **_build_kwargs(['temp_ref', 'k', 'cap_adjustment'], array.module_parameters)) for array, effective_irradiance, temp_cell in zip(self.arrays, effective_irradiance, temp_cell) ) From 8437f3957fd4119200d7bb1313968de66be9f0dd Mon Sep 17 00:00:00 2001 From: Marco Fumagalli <2473326+fuma900@users.noreply.github.com> Date: Wed, 11 Mar 2026 09:34:54 +0000 Subject: [PATCH 2/8] Add 'k' and 'cap_adjustment' parameters to module_parameters in pvwatts_system_kwargs fixture --- tests/test_pvsystem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_pvsystem.py b/tests/test_pvsystem.py index 4fbd782e65..089ecfb225 100644 --- a/tests/test_pvsystem.py +++ b/tests/test_pvsystem.py @@ -2260,7 +2260,7 @@ def pvwatts_system_defaults(): @pytest.fixture def pvwatts_system_kwargs(): - module_parameters = {'pdc0': 100, 'gamma_pdc': -0.003, 'temp_ref': 20} + module_parameters = {'pdc0': 100, 'gamma_pdc': -0.003, 'temp_ref': 20, 'k': 0.01, 'cap_adjustment': True} inverter_parameters = {'pdc0': 90, 'eta_inv_nom': 0.95, 'eta_inv_ref': 1.0} system = pvsystem.PVSystem(module_parameters=module_parameters, inverter_parameters=inverter_parameters) From 9b1e59b3adf1597203828dce3c90858341c421a3 Mon Sep 17 00:00:00 2001 From: Marco Fumagalli <2473326+fuma900@users.noreply.github.com> Date: Wed, 11 Mar 2026 09:57:01 +0000 Subject: [PATCH 3/8] Add enhancement entry in v0.15.1 release notes and add contributor --- docs/sphinx/source/whatsnew/v0.15.1.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.15.1.rst b/docs/sphinx/source/whatsnew/v0.15.1.rst index 5e93232eed..58c0b2c75f 100644 --- a/docs/sphinx/source/whatsnew/v0.15.1.rst +++ b/docs/sphinx/source/whatsnew/v0.15.1.rst @@ -20,7 +20,8 @@ Bug fixes Enhancements ~~~~~~~~~~~~ - +* Use ``k`` and ``cap_adjustment`` from :py:func:`pvlib.pvsystem.Array.module_parameters` in :py:func:`pvlib.pvsystem.PVSystem.pvwatts_dc` + (:issue:`2714`, :pull:`2715`) Documentation ~~~~~~~~~~~~~ @@ -70,4 +71,5 @@ Contributors * Anton Driesse (:ghuser:`adriesse`) * Kevin Anderson (:ghuser:`kandersolar`) * Rohan Saxena (:ghuser:`r0hansaxena`) +* Marco Fumagalli (:ghuser:`fuma900`) From 1d94dc72f3f9b1fc7f204695acecbc9c3564f9cb Mon Sep 17 00:00:00 2001 From: Marco Fumagalli <2473326+fuma900@users.noreply.github.com> Date: Wed, 11 Mar 2026 14:55:43 +0000 Subject: [PATCH 4/8] Update docstring in PVSystem.pvwatts_dc --- pvlib/pvsystem.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index c2c6a9d3cc..5e570a3168 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -850,7 +850,8 @@ 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']`. + `self.module_parameters['gamma_pdc']`, `self.module_parameters['temp_ref']`, + `self.module_parameters['k']`, `self.module_parameters['cap_adjustment']`. See :py:func:`pvlib.pvsystem.pvwatts_dc` for details. """ From c8af6755bedacf17748a8332eed1d121f350760e Mon Sep 17 00:00:00 2001 From: Marco Fumagalli <2473326+fuma900@users.noreply.github.com> Date: Wed, 11 Mar 2026 14:59:46 +0000 Subject: [PATCH 5/8] Fix linting failure --- pvlib/pvsystem.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index 5e570a3168..a1b5883534 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -850,8 +850,9 @@ 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']`, - `self.module_parameters['gamma_pdc']`, `self.module_parameters['temp_ref']`, - `self.module_parameters['k']`, `self.module_parameters['cap_adjustment']`. + `self.module_parameters['gamma_pdc']`, + `self.module_parameters['temp_ref']`, `self.module_parameters['k']`, + `self.module_parameters['cap_adjustment']`. See :py:func:`pvlib.pvsystem.pvwatts_dc` for details. """ @@ -861,7 +862,8 @@ def pvwatts_dc(self, effective_irradiance, temp_cell): pvwatts_dc(effective_irradiance, temp_cell, array.module_parameters['pdc0'], array.module_parameters['gamma_pdc'], - **_build_kwargs(['temp_ref', 'k', 'cap_adjustment'], array.module_parameters)) + **_build_kwargs(['temp_ref', 'k', 'cap_adjustment'], + array.module_parameters)) for array, effective_irradiance, temp_cell in zip(self.arrays, effective_irradiance, temp_cell) ) From 2e312c1e6139503cacd5d80378e89ccb5587b835 Mon Sep 17 00:00:00 2001 From: Marco Fumagalli <2473326+fuma900@users.noreply.github.com> Date: Wed, 11 Mar 2026 15:23:14 +0000 Subject: [PATCH 6/8] Fix linting failure --- tests/test_pvsystem.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_pvsystem.py b/tests/test_pvsystem.py index 089ecfb225..2f2c666554 100644 --- a/tests/test_pvsystem.py +++ b/tests/test_pvsystem.py @@ -2260,7 +2260,8 @@ def pvwatts_system_defaults(): @pytest.fixture def pvwatts_system_kwargs(): - module_parameters = {'pdc0': 100, 'gamma_pdc': -0.003, 'temp_ref': 20, 'k': 0.01, 'cap_adjustment': True} + module_parameters = {'pdc0': 100, 'gamma_pdc': -0.003, 'temp_ref': 20, + 'k': 0.01, 'cap_adjustment': True} inverter_parameters = {'pdc0': 90, 'eta_inv_nom': 0.95, 'eta_inv_ref': 1.0} system = pvsystem.PVSystem(module_parameters=module_parameters, inverter_parameters=inverter_parameters) From ef33f9c249f650c3d9b9d0ab8c5c7b8bac16e557 Mon Sep 17 00:00:00 2001 From: Marco Fumagalli <2473326+fuma900@users.noreply.github.com> Date: Wed, 11 Mar 2026 15:54:54 +0000 Subject: [PATCH 7/8] Update docstring in PVSystem.pvwatts_dc Co-authored-by: Cliff Hansen --- pvlib/pvsystem.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index a1b5883534..a2b29497c2 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -851,7 +851,8 @@ 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']`, `self.module_parameters['gamma_pdc']`, - `self.module_parameters['temp_ref']`, `self.module_parameters['k']`, + `self.module_parameters['temp_ref']`, and optionally, + `self.module_parameters['k']` and `self.module_parameters['cap_adjustment']`. See :py:func:`pvlib.pvsystem.pvwatts_dc` for details. From 94516a600b3b55c7a22b94fbcfdb650766e8d9fe Mon Sep 17 00:00:00 2001 From: Cliff Hansen Date: Thu, 12 Mar 2026 15:35:58 -0700 Subject: [PATCH 8/8] Apply suggestion from @RDaxini Co-authored-by: Rajiv Daxini <143435106+RDaxini@users.noreply.github.com> --- docs/sphinx/source/whatsnew/v0.15.1.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/sphinx/source/whatsnew/v0.15.1.rst b/docs/sphinx/source/whatsnew/v0.15.1.rst index 58c0b2c75f..a36ead8aba 100644 --- a/docs/sphinx/source/whatsnew/v0.15.1.rst +++ b/docs/sphinx/source/whatsnew/v0.15.1.rst @@ -22,6 +22,7 @@ Enhancements ~~~~~~~~~~~~ * Use ``k`` and ``cap_adjustment`` from :py:func:`pvlib.pvsystem.Array.module_parameters` in :py:func:`pvlib.pvsystem.PVSystem.pvwatts_dc` (:issue:`2714`, :pull:`2715`) + Documentation ~~~~~~~~~~~~~