Skip to content
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e73a4e8
Add examples for run_model_from_poa and run_model_from_effective_irra…
Chirag3841 Dec 11, 2025
b0aaaa1
Update pvlib/modelchain.py
Chirag3841 Dec 11, 2025
94a7864
Fix lint errors (W291 trailing whitespace)
Chirag3841 Dec 12, 2025
406a4a0
Fix lint errors (W291/W293) in modelchain.py
Chirag3841 Dec 12, 2025
c654dba
Fix doctests for run_model_from_poa and run_model_from_effective_irra…
Chirag3841 Feb 5, 2026
af125da
Fix doctests for run_model_from_poa and run_model_from_effective_irra…
Chirag3841 Feb 5, 2026
cbbcc81
Fix doctests for run_model_from_poa and run_model_from_effective_irra…
Chirag3841 Feb 5, 2026
6d21cfb
Fix doctests for run_model_from_poa and run_model_from_effective_irra…
Chirag3841 Feb 5, 2026
b065045
Fix docstring examples for ModelChain methods
Chirag3841 Feb 6, 2026
c37a3a3
Merge remote-tracking branch 'upstream/main' into add-examples-poa-irrad
Chirag3841 Feb 6, 2026
050c4f7
Fix ModelChain doctest examples
Chirag3841 Feb 6, 2026
198dab7
Fix pvwatts doctest parameters in examples
Chirag3841 Feb 6, 2026
e71fca3
Fix doctests for run_model_from_poa and run_model_from_effective_irra…
Chirag3841 Feb 6, 2026
e340950
Fix pvwatts doctest parameters in examples
Chirag3841 Feb 6, 2026
154be03
Fix doctest examples for run_model_from_poa and run_model_from_effect…
Chirag3841 Feb 6, 2026
2546993
Fix ModelChain docstring examples for pvwatts
Chirag3841 Feb 6, 2026
d09c896
Fix ModelChain docstring examples for pvwatts
Chirag3841 Feb 6, 2026
4984391
Fix doctest outputs for ModelChain run_model examples
Chirag3841 Feb 5, 2026
740ade1
Update pvlib/modelchain.py
Chirag3841 Feb 6, 2026
681fed4
Update pvlib/modelchain.py
Chirag3841 Feb 6, 2026
7a96db2
Update pvlib/modelchain.py
Chirag3841 Feb 6, 2026
9ac40da
Update pvlib/modelchain.py
Chirag3841 Feb 6, 2026
6a046e7
Update pvlib/modelchain.py
Chirag3841 Feb 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions pvlib/modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1713,6 +1713,77 @@ 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, 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}
... )
>>> 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({
... '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:

>>> 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': 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],
... '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
-----
Expand Down Expand Up @@ -1798,6 +1869,78 @@ 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, 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}
... )
>>> 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"
... )
>>> 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:

>>> 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': 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"
... )
>>> 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
-----
Expand Down