From e73a4e8ef1afbb1ffa8464a461f5b2089e6f1110 Mon Sep 17 00:00:00 2001 From: Chirag3841 Date: Thu, 11 Dec 2025 21:26:52 +0530 Subject: [PATCH 01/14] Add examples for run_model_from_poa and run_model_from_effective_irradiance --- pvlib/modelchain.py | 88 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 09e4434e84..4db4140141 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -1713,6 +1713,50 @@ def run_model_from_poa(self, data): of Arrays in the PVSystem. ValueError If the DataFrames in `data` have different indexes. + Examples + -------- + Single-array system: + + >>> import pandas as pd + >>> from pvlib.pvsystem import PVSystem + >>> from pvlib.location import Location + >>> from pvlib.modelchain import ModelChain + >>> + >>> system = PVSystem(module_parameters={'pdc0': 300}) + >>> location = Location(35, -110) + >>> mc = ModelChain(system, location) + >>> + >>> poa = pd.DataFrame({ + ... 'poa_global': [900, 850], + ... 'poa_direct': [600, 560], + ... 'poa_diffuse': [300, 290], + ... }, + ... index=pd.date_range("2021-06-01", periods=2, freq="H")) + >>> + >>> mc.run_model_from_poa(poa) + + + Multi-array system: + + >>> array1 = Array(tilt=30, azimuth=180) + >>> array2 = Array(tilt=10, azimuth=90) + >>> system = PVSystem(arrays=[array1, array2], + ... module_parameters={'pdc0': 300}) + >>> mc = ModelChain(system, location) + >>> poa1 = pd.DataFrame({ + ... 'poa_global': [900, 880], + ... 'poa_direct': [600, 580], + ... 'poa_diffuse': [300, 300], + ... }, + ... index=pd.date_range("2021-06-01", periods=2, freq="H")) + >>> poa2 = pd.DataFrame({ + ... 'poa_global': [700, 720], + ... 'poa_direct': [400, 420], + ... 'poa_diffuse': [300, 300], + ... }, + ... index=poa1.index) + >>> mc.run_model_from_poa([poa1, poa2]) + Notes ----- @@ -1798,6 +1842,50 @@ def run_model_from_effective_irradiance(self, data): of Arrays in the PVSystem. ValueError If the DataFrames in `data` have different indexes. + Examples + -------- + Single-array system: + + >>> import pandas as pd + >>> from pvlib.pvsystem import PVSystem + >>> from pvlib.location import Location + >>> from pvlib.modelchain import ModelChain + >>> + >>> system = PVSystem(module_parameters={'pdc0': 300}) + >>> location = Location(35, -110) + >>> mc = ModelChain(system, location) + >>> + >>> eff = pd.DataFrame({ + ... 'effective_irradiance': [900, 920], + ... 'temp_air': [25, 24], + ... 'wind_speed': [2.0, 1.5], + ... }, + ... index=pd.date_range("2021-06-01", periods=2, freq="H")) + >>> + >>> mc.run_model_from_effective_irradiance(eff) + + + Multi-array system: + + >>> array1 = Array(tilt=30, azimuth=180) + >>> array2 = Array(tilt=10, azimuth=90) + >>> system = PVSystem(arrays=[array1, array2], + ... module_parameters={'pdc0': 300}) + >>> mc = ModelChain(system, location) + >>> eff1 = pd.DataFrame({ + ... 'effective_irradiance': [900, 920], + ... 'temp_air': [25, 24], + ... 'wind_speed': [2.0, 1.5], + ... }, + ... index=pd.date_range("2021-06-01", periods=2, freq="H")) + >>> eff2 = pd.DataFrame({ + ... 'effective_irradiance': [600, 630], + ... 'temp_air': [26, 25], + ... 'wind_speed': [1.8, 1.2], + ... }, + ... index=eff1.index) + >>> mc.run_model_from_effective_irradiance([eff1, eff2]) + Notes ----- From b0aaaa18c6d68df1b4a832b0fb083549a2687a47 Mon Sep 17 00:00:00 2001 From: Chirag3841 <160767827+Chirag3841@users.noreply.github.com> Date: Thu, 11 Dec 2025 23:37:37 +0530 Subject: [PATCH 02/14] Update pvlib/modelchain.py Co-authored-by: Cliff Hansen --- pvlib/modelchain.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 4db4140141..53ea00803f 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -1842,7 +1842,8 @@ def run_model_from_effective_irradiance(self, data): of Arrays in the PVSystem. ValueError If the DataFrames in `data` have different indexes. - Examples + + Examples -------- Single-array system: From 94a7864d54da1e09d83a002b0d8252e864cdedb4 Mon Sep 17 00:00:00 2001 From: Chirag3841 Date: Fri, 12 Dec 2025 10:16:15 +0530 Subject: [PATCH 03/14] Fix lint errors (W291 trailing whitespace) --- pvlib/modelchain.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 53ea00803f..0f5b0b9d69 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -1842,7 +1842,6 @@ def run_model_from_effective_irradiance(self, data): of Arrays in the PVSystem. ValueError If the DataFrames in `data` have different indexes. - Examples -------- Single-array system: @@ -1867,7 +1866,7 @@ def run_model_from_effective_irradiance(self, data): Multi-array system: - + >>> array1 = Array(tilt=30, azimuth=180) >>> array2 = Array(tilt=10, azimuth=90) >>> system = PVSystem(arrays=[array1, array2], From 406a4a071c068ec1a0633d748e5bbfe37be6f686 Mon Sep 17 00:00:00 2001 From: Chirag3841 Date: Fri, 12 Dec 2025 10:44:02 +0530 Subject: [PATCH 04/14] Fix lint errors (W291/W293) in modelchain.py --- pvlib/modelchain.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 0f5b0b9d69..94fb3543fd 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -1718,7 +1718,7 @@ def run_model_from_poa(self, data): Single-array system: >>> import pandas as pd - >>> from pvlib.pvsystem import PVSystem + >>> from pvlib.pvsystem import PVSystem, Array, FixedMount >>> from pvlib.location import Location >>> from pvlib.modelchain import ModelChain >>> @@ -1730,16 +1730,17 @@ def run_model_from_poa(self, data): ... 'poa_global': [900, 850], ... 'poa_direct': [600, 560], ... 'poa_diffuse': [300, 290], - ... }, + ... }, ... index=pd.date_range("2021-06-01", periods=2, freq="H")) >>> >>> mc.run_model_from_poa(poa) Multi-array system: - - >>> array1 = Array(tilt=30, azimuth=180) - >>> array2 = Array(tilt=10, azimuth=90) + >>> mount1 = FixedMount(surface_tilt=30, surface_azimuth=180) + >>> mount2 = FixedMount(surface_tilt=10, surface_azimuth=90) + >>> array1 = Array(mount=mount1) + >>> array2 = Array(mount=mount2) >>> system = PVSystem(arrays=[array1, array2], ... module_parameters={'pdc0': 300}) >>> mc = ModelChain(system, location) @@ -1845,9 +1846,8 @@ def run_model_from_effective_irradiance(self, data): Examples -------- Single-array system: - >>> import pandas as pd - >>> from pvlib.pvsystem import PVSystem + >>> from pvlib.pvsystem import PVSystem, Array, FixedMount >>> from pvlib.location import Location >>> from pvlib.modelchain import ModelChain >>> @@ -1866,9 +1866,10 @@ def run_model_from_effective_irradiance(self, data): Multi-array system: - - >>> array1 = Array(tilt=30, azimuth=180) - >>> array2 = Array(tilt=10, azimuth=90) + >>> mount1 = FixedMount(surface_tilt=30, surface_azimuth=180) + >>> mount2 = FixedMount(surface_tilt=10, surface_azimuth=90) + >>> array1 = Array(mount=mount1) + >>> array2 = Array(mount=mount2) >>> system = PVSystem(arrays=[array1, array2], ... module_parameters={'pdc0': 300}) >>> mc = ModelChain(system, location) From b065045dc74abd81e9f61613da062dea43fa7de2 Mon Sep 17 00:00:00 2001 From: Chirag3841 Date: Fri, 6 Feb 2026 09:11:48 +0530 Subject: [PATCH 05/14] Fix docstring examples for ModelChain methods --- pvlib/modelchain.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 94fb3543fd..f1685a0705 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -1721,11 +1721,11 @@ def run_model_from_poa(self, data): >>> from pvlib.pvsystem import PVSystem, Array, FixedMount >>> from pvlib.location import Location >>> from pvlib.modelchain import ModelChain - >>> - >>> system = PVSystem(module_parameters={'pdc0': 300}) >>> location = Location(35, -110) + >>> mount = FixedMount(surface_tilt=30, surface_azimuth=180) + >>> array = Array(mount=mount, module_parameters={'pdc0': 300}) + >>> system = PVSystem(arrays=[array]) >>> mc = ModelChain(system, location) - >>> >>> poa = pd.DataFrame({ ... 'poa_global': [900, 850], ... 'poa_direct': [600, 560], @@ -1737,12 +1737,12 @@ def run_model_from_poa(self, data): Multi-array system: + >>> mount1 = FixedMount(surface_tilt=30, surface_azimuth=180) >>> mount2 = FixedMount(surface_tilt=10, surface_azimuth=90) - >>> array1 = Array(mount=mount1) - >>> array2 = Array(mount=mount2) - >>> system = PVSystem(arrays=[array1, array2], - ... module_parameters={'pdc0': 300}) + >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300}) + >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300}) + >>> system = PVSystem(arrays=[array1, array2]) >>> mc = ModelChain(system, location) >>> poa1 = pd.DataFrame({ ... 'poa_global': [900, 880], @@ -1846,13 +1846,15 @@ def run_model_from_effective_irradiance(self, data): Examples -------- Single-array system: + >>> import pandas as pd >>> from pvlib.pvsystem import PVSystem, Array, FixedMount >>> from pvlib.location import Location >>> from pvlib.modelchain import ModelChain - >>> - >>> system = PVSystem(module_parameters={'pdc0': 300}) >>> location = Location(35, -110) + >>> mount = FixedMount(surface_tilt=30, surface_azimuth=180) + >>> array = Array(mount=mount, module_parameters={'pdc0': 300}) + >>> system = PVSystem(arrays=[array]) >>> mc = ModelChain(system, location) >>> >>> eff = pd.DataFrame({ @@ -1866,12 +1868,12 @@ def run_model_from_effective_irradiance(self, data): Multi-array system: + >>> mount1 = FixedMount(surface_tilt=30, surface_azimuth=180) >>> mount2 = FixedMount(surface_tilt=10, surface_azimuth=90) - >>> array1 = Array(mount=mount1) - >>> array2 = Array(mount=mount2) - >>> system = PVSystem(arrays=[array1, array2], - ... module_parameters={'pdc0': 300}) + >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300}) + >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300}) + >>> system = PVSystem(arrays=[array1, array2]) >>> mc = ModelChain(system, location) >>> eff1 = pd.DataFrame({ ... 'effective_irradiance': [900, 920], From 050c4f7e08c1a164fdec6eb09ef5d14e9501295d Mon Sep 17 00:00:00 2001 From: Chirag3841 Date: Fri, 6 Feb 2026 09:21:38 +0530 Subject: [PATCH 06/14] Fix ModelChain doctest examples --- pvlib/modelchain.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index f1685a0705..05fbc4751b 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -1725,13 +1725,13 @@ def run_model_from_poa(self, data): >>> mount = FixedMount(surface_tilt=30, surface_azimuth=180) >>> array = Array(mount=mount, module_parameters={'pdc0': 300}) >>> system = PVSystem(arrays=[array]) - >>> mc = ModelChain(system, location) + >>> mc = ModelChain(system, location,dc_model="pvwatts") >>> poa = pd.DataFrame({ ... 'poa_global': [900, 850], ... 'poa_direct': [600, 560], ... 'poa_diffuse': [300, 290], ... }, - ... index=pd.date_range("2021-06-01", periods=2, freq="H")) + ... index=pd.date_range("2021-06-01", periods=2, freq="h")) >>> >>> mc.run_model_from_poa(poa) @@ -1743,13 +1743,13 @@ def run_model_from_poa(self, data): >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300}) >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300}) >>> system = PVSystem(arrays=[array1, array2]) - >>> mc = ModelChain(system, location) + >>> mc = ModelChain(system, location,dc_model="pvwatts") >>> poa1 = pd.DataFrame({ ... 'poa_global': [900, 880], ... 'poa_direct': [600, 580], ... 'poa_diffuse': [300, 300], ... }, - ... index=pd.date_range("2021-06-01", periods=2, freq="H")) + ... index=pd.date_range("2021-06-01", periods=2, freq="h")) >>> poa2 = pd.DataFrame({ ... 'poa_global': [700, 720], ... 'poa_direct': [400, 420], @@ -1855,14 +1855,14 @@ def run_model_from_effective_irradiance(self, data): >>> mount = FixedMount(surface_tilt=30, surface_azimuth=180) >>> array = Array(mount=mount, module_parameters={'pdc0': 300}) >>> system = PVSystem(arrays=[array]) - >>> mc = ModelChain(system, location) + >>> mc = ModelChain(system, location,dc_model="pvwatts") >>> >>> eff = pd.DataFrame({ ... 'effective_irradiance': [900, 920], ... 'temp_air': [25, 24], ... 'wind_speed': [2.0, 1.5], ... }, - ... index=pd.date_range("2021-06-01", periods=2, freq="H")) + ... index=pd.date_range("2021-06-01", periods=2, freq="h")) >>> >>> mc.run_model_from_effective_irradiance(eff) @@ -1874,13 +1874,13 @@ def run_model_from_effective_irradiance(self, data): >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300}) >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300}) >>> system = PVSystem(arrays=[array1, array2]) - >>> mc = ModelChain(system, location) + >>> mc = ModelChain(system, location,dc_model="pvwatts") >>> eff1 = pd.DataFrame({ ... 'effective_irradiance': [900, 920], ... 'temp_air': [25, 24], ... 'wind_speed': [2.0, 1.5], ... }, - ... index=pd.date_range("2021-06-01", periods=2, freq="H")) + ... index=pd.date_range("2021-06-01", periods=2, freq="h")) >>> eff2 = pd.DataFrame({ ... 'effective_irradiance': [600, 630], ... 'temp_air': [26, 25], From 198dab78b369ece3c8238b2e8cdc945193c15e37 Mon Sep 17 00:00:00 2001 From: Chirag3841 Date: Fri, 6 Feb 2026 09:24:36 +0530 Subject: [PATCH 07/14] Fix pvwatts doctest parameters in examples --- pvlib/modelchain.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 05fbc4751b..ef3d6f5aad 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -1723,7 +1723,7 @@ def run_model_from_poa(self, data): >>> from pvlib.modelchain import ModelChain >>> location = Location(35, -110) >>> mount = FixedMount(surface_tilt=30, surface_azimuth=180) - >>> array = Array(mount=mount, module_parameters={'pdc0': 300}) + >>> array = Array(mount=mount, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) >>> system = PVSystem(arrays=[array]) >>> mc = ModelChain(system, location,dc_model="pvwatts") >>> poa = pd.DataFrame({ @@ -1740,8 +1740,8 @@ def run_model_from_poa(self, data): >>> mount1 = FixedMount(surface_tilt=30, surface_azimuth=180) >>> mount2 = FixedMount(surface_tilt=10, surface_azimuth=90) - >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300}) - >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300}) + >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) + >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) >>> system = PVSystem(arrays=[array1, array2]) >>> mc = ModelChain(system, location,dc_model="pvwatts") >>> poa1 = pd.DataFrame({ @@ -1853,7 +1853,7 @@ def run_model_from_effective_irradiance(self, data): >>> from pvlib.modelchain import ModelChain >>> location = Location(35, -110) >>> mount = FixedMount(surface_tilt=30, surface_azimuth=180) - >>> array = Array(mount=mount, module_parameters={'pdc0': 300}) + >>> array = Array(mount=mount,module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) >>> system = PVSystem(arrays=[array]) >>> mc = ModelChain(system, location,dc_model="pvwatts") >>> @@ -1871,8 +1871,8 @@ def run_model_from_effective_irradiance(self, data): >>> mount1 = FixedMount(surface_tilt=30, surface_azimuth=180) >>> mount2 = FixedMount(surface_tilt=10, surface_azimuth=90) - >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300}) - >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300}) + >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) + >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) >>> system = PVSystem(arrays=[array1, array2]) >>> mc = ModelChain(system, location,dc_model="pvwatts") >>> eff1 = pd.DataFrame({ From e34095076e29d893253d2638ba574c4175623254 Mon Sep 17 00:00:00 2001 From: Chirag3841 Date: Fri, 6 Feb 2026 09:27:18 +0530 Subject: [PATCH 08/14] Fix pvwatts doctest parameters in examples --- pvlib/modelchain.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index ef3d6f5aad..8b019c4b19 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -1724,8 +1724,8 @@ def run_model_from_poa(self, data): >>> location = Location(35, -110) >>> mount = FixedMount(surface_tilt=30, surface_azimuth=180) >>> array = Array(mount=mount, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) - >>> system = PVSystem(arrays=[array]) - >>> mc = ModelChain(system, location,dc_model="pvwatts") + >>> system = PVSystem(arrays=[array],inverter_parameters={'pdc0': 300}) + >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts") >>> poa = pd.DataFrame({ ... 'poa_global': [900, 850], ... 'poa_direct': [600, 560], @@ -1742,8 +1742,8 @@ def run_model_from_poa(self, data): >>> mount2 = FixedMount(surface_tilt=10, surface_azimuth=90) >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) - >>> system = PVSystem(arrays=[array1, array2]) - >>> mc = ModelChain(system, location,dc_model="pvwatts") + >>> system = PVSystem(arrays=[array1, array2],inverter_parameters={'pdc0': 300}) + >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts") >>> poa1 = pd.DataFrame({ ... 'poa_global': [900, 880], ... 'poa_direct': [600, 580], @@ -1854,8 +1854,8 @@ def run_model_from_effective_irradiance(self, data): >>> location = Location(35, -110) >>> mount = FixedMount(surface_tilt=30, surface_azimuth=180) >>> array = Array(mount=mount,module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) - >>> system = PVSystem(arrays=[array]) - >>> mc = ModelChain(system, location,dc_model="pvwatts") + >>> system = PVSystem(arrays=[array],inverter_parameters={'pdc0': 300}) + >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts") >>> >>> eff = pd.DataFrame({ ... 'effective_irradiance': [900, 920], @@ -1873,8 +1873,8 @@ def run_model_from_effective_irradiance(self, data): >>> mount2 = FixedMount(surface_tilt=10, surface_azimuth=90) >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) - >>> system = PVSystem(arrays=[array1, array2]) - >>> mc = ModelChain(system, location,dc_model="pvwatts") + >>> system = PVSystem(arrays=[array1, array2],inverter_parameters={'pdc0': 300}) + >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts") >>> eff1 = pd.DataFrame({ ... 'effective_irradiance': [900, 920], ... 'temp_air': [25, 24], From 154be032d55cde8d7e0b6be38802a4cc8b4b921e Mon Sep 17 00:00:00 2001 From: Chirag3841 Date: Fri, 6 Feb 2026 09:29:17 +0530 Subject: [PATCH 09/14] Fix doctest examples for run_model_from_poa and run_model_from_effective_irradiance --- pvlib/modelchain.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 8b019c4b19..b283bd56a9 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -1725,7 +1725,7 @@ def run_model_from_poa(self, data): >>> mount = FixedMount(surface_tilt=30, surface_azimuth=180) >>> array = Array(mount=mount, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) >>> system = PVSystem(arrays=[array],inverter_parameters={'pdc0': 300}) - >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts") + >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss") >>> poa = pd.DataFrame({ ... 'poa_global': [900, 850], ... 'poa_direct': [600, 560], @@ -1743,7 +1743,7 @@ def run_model_from_poa(self, data): >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) >>> system = PVSystem(arrays=[array1, array2],inverter_parameters={'pdc0': 300}) - >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts") + >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss") >>> poa1 = pd.DataFrame({ ... 'poa_global': [900, 880], ... 'poa_direct': [600, 580], @@ -1855,7 +1855,7 @@ def run_model_from_effective_irradiance(self, data): >>> mount = FixedMount(surface_tilt=30, surface_azimuth=180) >>> array = Array(mount=mount,module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) >>> system = PVSystem(arrays=[array],inverter_parameters={'pdc0': 300}) - >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts") + >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss") >>> >>> eff = pd.DataFrame({ ... 'effective_irradiance': [900, 920], @@ -1874,7 +1874,7 @@ def run_model_from_effective_irradiance(self, data): >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) >>> system = PVSystem(arrays=[array1, array2],inverter_parameters={'pdc0': 300}) - >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts") + >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss") >>> eff1 = pd.DataFrame({ ... 'effective_irradiance': [900, 920], ... 'temp_air': [25, 24], From 2546993b9fd632773c4b64ab2f77a64973e0d246 Mon Sep 17 00:00:00 2001 From: Chirag3841 Date: Fri, 6 Feb 2026 09:30:48 +0530 Subject: [PATCH 10/14] Fix ModelChain docstring examples for pvwatts --- pvlib/modelchain.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index b283bd56a9..689410ab49 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -1725,7 +1725,7 @@ def run_model_from_poa(self, data): >>> mount = FixedMount(surface_tilt=30, surface_azimuth=180) >>> array = Array(mount=mount, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) >>> system = PVSystem(arrays=[array],inverter_parameters={'pdc0': 300}) - >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss") + >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss", temperature_model="faiman") >>> poa = pd.DataFrame({ ... 'poa_global': [900, 850], ... 'poa_direct': [600, 560], @@ -1743,7 +1743,7 @@ def run_model_from_poa(self, data): >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) >>> system = PVSystem(arrays=[array1, array2],inverter_parameters={'pdc0': 300}) - >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss") + >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss", temperature_model="faiman") >>> poa1 = pd.DataFrame({ ... 'poa_global': [900, 880], ... 'poa_direct': [600, 580], @@ -1855,7 +1855,7 @@ def run_model_from_effective_irradiance(self, data): >>> mount = FixedMount(surface_tilt=30, surface_azimuth=180) >>> array = Array(mount=mount,module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) >>> system = PVSystem(arrays=[array],inverter_parameters={'pdc0': 300}) - >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss") + >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss", temperature_model="faiman") >>> >>> eff = pd.DataFrame({ ... 'effective_irradiance': [900, 920], @@ -1874,7 +1874,7 @@ def run_model_from_effective_irradiance(self, data): >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) >>> system = PVSystem(arrays=[array1, array2],inverter_parameters={'pdc0': 300}) - >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss") + >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss",temperature_model="faiman") >>> eff1 = pd.DataFrame({ ... 'effective_irradiance': [900, 920], ... 'temp_air': [25, 24], From d09c89633e0c7c12177addc7dfea48f5976e5ed9 Mon Sep 17 00:00:00 2001 From: Chirag3841 Date: Fri, 6 Feb 2026 09:33:27 +0530 Subject: [PATCH 11/14] Fix ModelChain docstring examples for pvwatts --- pvlib/modelchain.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 689410ab49..4f6a7b716a 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -1723,7 +1723,7 @@ def run_model_from_poa(self, data): >>> from pvlib.modelchain import ModelChain >>> location = Location(35, -110) >>> mount = FixedMount(surface_tilt=30, surface_azimuth=180) - >>> array = Array(mount=mount, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) + >>> array = Array(mount=mount, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004},temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) >>> system = PVSystem(arrays=[array],inverter_parameters={'pdc0': 300}) >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss", temperature_model="faiman") >>> poa = pd.DataFrame({ @@ -1740,8 +1740,8 @@ def run_model_from_poa(self, data): >>> mount1 = FixedMount(surface_tilt=30, surface_azimuth=180) >>> mount2 = FixedMount(surface_tilt=10, surface_azimuth=90) - >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) - >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) + >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}, temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) + >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}, temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) >>> system = PVSystem(arrays=[array1, array2],inverter_parameters={'pdc0': 300}) >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss", temperature_model="faiman") >>> poa1 = pd.DataFrame({ @@ -1853,7 +1853,7 @@ def run_model_from_effective_irradiance(self, data): >>> from pvlib.modelchain import ModelChain >>> location = Location(35, -110) >>> mount = FixedMount(surface_tilt=30, surface_azimuth=180) - >>> array = Array(mount=mount,module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) + >>> array = Array(mount=mount,module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}, temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) >>> system = PVSystem(arrays=[array],inverter_parameters={'pdc0': 300}) >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss", temperature_model="faiman") >>> @@ -1871,8 +1871,8 @@ def run_model_from_effective_irradiance(self, data): >>> mount1 = FixedMount(surface_tilt=30, surface_azimuth=180) >>> mount2 = FixedMount(surface_tilt=10, surface_azimuth=90) - >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) - >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}) + >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}, temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) + >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}, temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) >>> system = PVSystem(arrays=[array1, array2],inverter_parameters={'pdc0': 300}) >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss",temperature_model="faiman") >>> eff1 = pd.DataFrame({ From 49843918c31dad8c42f348fe87fa5a862270c17b Mon Sep 17 00:00:00 2001 From: Chirag3841 Date: Fri, 6 Feb 2026 00:08:29 +0530 Subject: [PATCH 12/14] Fix doctest outputs for ModelChain run_model examples --- pvlib/modelchain.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 4f6a7b716a..6b7bf03d89 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -1733,8 +1733,7 @@ def run_model_from_poa(self, data): ... }, ... index=pd.date_range("2021-06-01", periods=2, freq="h")) >>> - >>> mc.run_model_from_poa(poa) - + >>> _ = mc.run_model_from_poa(poa) Multi-array system: @@ -1756,8 +1755,7 @@ def run_model_from_poa(self, data): ... 'poa_diffuse': [300, 300], ... }, ... index=poa1.index) - >>> mc.run_model_from_poa([poa1, poa2]) - + >>> _ = mc.run_model_from_poa([poa1, poa2]) Notes ----- @@ -1864,8 +1862,7 @@ def run_model_from_effective_irradiance(self, data): ... }, ... index=pd.date_range("2021-06-01", periods=2, freq="h")) >>> - >>> mc.run_model_from_effective_irradiance(eff) - + >>> _ = mc.run_model_from_effective_irradiance(eff) Multi-array system: @@ -1887,8 +1884,8 @@ def run_model_from_effective_irradiance(self, data): ... 'wind_speed': [1.8, 1.2], ... }, ... index=eff1.index) - >>> mc.run_model_from_effective_irradiance([eff1, eff2]) - + >>> _ = mc.run_model_from_effective_irradiance([eff1, eff2]) + Notes ----- From c654dbaad9330c41efb39ed9149ca75b020923fb Mon Sep 17 00:00:00 2001 From: Chirag3841 Date: Fri, 6 Feb 2026 01:51:33 +0530 Subject: [PATCH 13/14] Fix doctests for run_model_from_poa and run_model_from_effective_irradiance --- pvlib/modelchain.py | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 6b7bf03d89..dac9e76584 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -1723,26 +1723,25 @@ def run_model_from_poa(self, data): >>> from pvlib.modelchain import ModelChain >>> location = Location(35, -110) >>> mount = FixedMount(surface_tilt=30, surface_azimuth=180) - >>> array = Array(mount=mount, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004},temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) + >>> array = Array(mount=mount,module_parameters={'pdc0': 300, 'gamma_pdc': -0.004},temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) >>> system = PVSystem(arrays=[array],inverter_parameters={'pdc0': 300}) - >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss", temperature_model="faiman") + >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts",aoi_model="no_loss",spectral_model="no_loss",temperature_model="faiman") >>> poa = pd.DataFrame({ ... 'poa_global': [900, 850], ... 'poa_direct': [600, 560], ... 'poa_diffuse': [300, 290], ... }, ... index=pd.date_range("2021-06-01", periods=2, freq="h")) - >>> - >>> _ = mc.run_model_from_poa(poa) + >>> mc.run_model_from_poa(poa) # doctest: +ELLIPSIS + ModelChain: ... Multi-array system: - >>> mount1 = FixedMount(surface_tilt=30, surface_azimuth=180) >>> mount2 = FixedMount(surface_tilt=10, surface_azimuth=90) - >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}, temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) - >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}, temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) - >>> system = PVSystem(arrays=[array1, array2],inverter_parameters={'pdc0': 300}) - >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss", temperature_model="faiman") + >>> array1 = Array(mount=mount1,module_parameters={'pdc0': 300, 'gamma_pdc': -0.004},temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) + >>> array2 = Array(mount=mount2,module_parameters={'pdc0': 200, 'gamma_pdc': -0.004},temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) + >>> system = PVSystem(arrays=[array1, array2],inverter_parameters={'pdc0': 500}) + >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts",aoi_model="no_loss",spectral_model="no_loss",temperature_model="faiman") >>> poa1 = pd.DataFrame({ ... 'poa_global': [900, 880], ... 'poa_direct': [600, 580], @@ -1755,8 +1754,8 @@ def run_model_from_poa(self, data): ... 'poa_diffuse': [300, 300], ... }, ... index=poa1.index) - >>> _ = mc.run_model_from_poa([poa1, poa2]) - + >>> mc.run_model_from_poa([poa1, poa2]) # doctest: +ELLIPSIS + ModelChain: ... Notes ----- Assigns attributes to results: ``times``, ``weather``, @@ -1844,34 +1843,31 @@ def run_model_from_effective_irradiance(self, data): Examples -------- Single-array system: - >>> import pandas as pd >>> from pvlib.pvsystem import PVSystem, Array, FixedMount >>> from pvlib.location import Location >>> from pvlib.modelchain import ModelChain >>> location = Location(35, -110) >>> mount = FixedMount(surface_tilt=30, surface_azimuth=180) - >>> array = Array(mount=mount,module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}, temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) + >>> array = Array(mount=mount, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004},temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) >>> system = PVSystem(arrays=[array],inverter_parameters={'pdc0': 300}) - >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss", temperature_model="faiman") - >>> + >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts",aoi_model="no_loss",spectral_model="no_loss",temperature_model="faiman") >>> eff = pd.DataFrame({ ... 'effective_irradiance': [900, 920], ... 'temp_air': [25, 24], ... 'wind_speed': [2.0, 1.5], ... }, ... index=pd.date_range("2021-06-01", periods=2, freq="h")) - >>> - >>> _ = mc.run_model_from_effective_irradiance(eff) + >>> mc.run_model_from_effective_irradiance(eff) # doctest: +ELLIPSIS + ModelChain: ... Multi-array system: - >>> mount1 = FixedMount(surface_tilt=30, surface_azimuth=180) >>> mount2 = FixedMount(surface_tilt=10, surface_azimuth=90) - >>> array1 = Array(mount=mount1, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}, temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) - >>> array2 = Array(mount=mount2, module_parameters={'pdc0': 300, 'gamma_pdc': -0.004}, temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) + >>> array1 = Array(tilt=30, azimuth=180,module_parameters={'pdc0': 300, 'gamma_pdc': -0.004},temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) + >>> array2 = Array(tilt=10, azimuth=90,module_parameters={'pdc0': 300, 'gamma_pdc': -0.004},temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) >>> system = PVSystem(arrays=[array1, array2],inverter_parameters={'pdc0': 300}) - >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts", aoi_model="no_loss", spectral_model="no_loss",temperature_model="faiman") + >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts",aoi_model="no_loss",spectral_model="no_loss",temperature_model="faiman") >>> eff1 = pd.DataFrame({ ... 'effective_irradiance': [900, 920], ... 'temp_air': [25, 24], @@ -1884,8 +1880,8 @@ def run_model_from_effective_irradiance(self, data): ... 'wind_speed': [1.8, 1.2], ... }, ... index=eff1.index) - >>> _ = mc.run_model_from_effective_irradiance([eff1, eff2]) - + >>> mc.run_model_from_effective_irradiance([eff1, eff2]) # doctest: +ELLIPSIS + ModelChain: ... Notes ----- From af125daba2aee4db1891a2a79c79cc679177696b Mon Sep 17 00:00:00 2001 From: Chirag3841 Date: Fri, 6 Feb 2026 01:56:28 +0530 Subject: [PATCH 14/14] Fix doctests for run_model_from_poa and run_model_from_effective_irradiance --- pvlib/modelchain.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index dac9e76584..ce64e5b0ef 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -1756,6 +1756,7 @@ def run_model_from_poa(self, data): ... index=poa1.index) >>> mc.run_model_from_poa([poa1, poa2]) # doctest: +ELLIPSIS ModelChain: ... + Notes ----- Assigns attributes to results: ``times``, ``weather``, @@ -1864,8 +1865,8 @@ def run_model_from_effective_irradiance(self, data): Multi-array system: >>> mount1 = FixedMount(surface_tilt=30, surface_azimuth=180) >>> mount2 = FixedMount(surface_tilt=10, surface_azimuth=90) - >>> array1 = Array(tilt=30, azimuth=180,module_parameters={'pdc0': 300, 'gamma_pdc': -0.004},temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) - >>> array2 = Array(tilt=10, azimuth=90,module_parameters={'pdc0': 300, 'gamma_pdc': -0.004},temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) + >>> array1 = Array(mount=mount1,module_parameters={'pdc0': 300, 'gamma_pdc': -0.004},temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) + >>> array2 = Array(mount=mount2,module_parameters={'pdc0': 300, 'gamma_pdc': -0.004},temperature_model_parameters={'u0': 25.0, 'u1': 6.84}) >>> system = PVSystem(arrays=[array1, array2],inverter_parameters={'pdc0': 300}) >>> mc = ModelChain(system, location,dc_model="pvwatts",ac_model="pvwatts",aoi_model="no_loss",spectral_model="no_loss",temperature_model="faiman") >>> eff1 = pd.DataFrame({