Skip to content

Commit 8eef3f3

Browse files
committed
Fixed indentation in run_model_from_poa function
1 parent f6709d0 commit 8eef3f3

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

pvlib/modelchain.py

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
# ModelChain, particularly they are used by the methods
6161
# ModelChain.with_pvwatts, ModelChain.with_sapm, etc.
6262

63+
64+
6365
# pvwatts documentation states that it uses the following reference for
6466
# a temperature model: Fuentes, M. K. (1987). A Simplified Thermal Model
6567
# for Flat-Plate Photovoltaic Arrays. SAND85-0330. Albuquerque, NM:
@@ -1730,6 +1732,27 @@ def run_model_from_poa(self, data):
17301732
of Arrays in the PVSystem.
17311733
ValueError
17321734
If the DataFrames in `data` have different indexes.
1735+
Examples
1736+
--------
1737+
Single-array system:
1738+
1739+
>>> import pandas as pd
1740+
>>> from pvlib.pvsystem import PVSystem
1741+
>>> from pvlib.location import Location
1742+
>>> from pvlib.modelchain import ModelChain
1743+
>>>
1744+
>>> system = PVSystem(module_parameters={'pdc0': 300})
1745+
>>> location = Location(35, -110)
1746+
>>> mc = ModelChain(system, location)
1747+
>>>
1748+
>>> poa = pd.DataFrame({
1749+
... 'poa_global': [900, 850],
1750+
... 'poa_direct': [600, 560],
1751+
... 'poa_diffuse': [300, 290],
1752+
... }, index=pd.date_range("2021-06-01", periods=2, freq="H"))
1753+
>>>
1754+
>>> mc.run_model_from_poa(poa)
1755+
<pvlib.modelchain.ModelChain ...>
17331756
17341757
Notes
17351758
-----
@@ -1755,7 +1778,6 @@ def run_model_from_poa(self, data):
17551778
self._run_from_effective_irrad(data)
17561779

17571780
return self
1758-
17591781
def _run_from_effective_irrad(self, data):
17601782
"""
17611783
Executes the temperature, DC, losses and AC models.
@@ -1774,7 +1796,7 @@ def _run_from_effective_irrad(self, data):
17741796
17751797
Notes
17761798
-----
1777-
Assigns attributes:``cell_temperature``, ``dc``, ``ac``, ``losses``,
1799+
Assigns attributes:``cell_temperature, 'dc', ``ac', ``losses``,
17781800
``diode_params`` (if dc_model is a single diode model).
17791801
"""
17801802
self._prepare_temperature(data)
@@ -1815,6 +1837,25 @@ def run_model_from_effective_irradiance(self, data):
18151837
of Arrays in the PVSystem.
18161838
ValueError
18171839
If the DataFrames in `data` have different indexes.
1840+
Examples
1841+
--------
1842+
>>> import pandas as pd
1843+
>>> from pvlib.pvsystem import PVSystem
1844+
>>> from pvlib.location import Location
1845+
>>> from pvlib.modelchain import ModelChain
1846+
>>>
1847+
>>> system = PVSystem(module_parameters={'pdc0': 300})
1848+
>>> location = Location(35, -110)
1849+
>>> mc = ModelChain(system, location)
1850+
>>>
1851+
>>> eff = pd.DataFrame({
1852+
... 'effective_irradiance': [900, 920],
1853+
... 'temp_air': [25, 24],
1854+
... 'wind_speed': [2.0, 1.5],
1855+
... })
1856+
>>>
1857+
>>> mc.run_model_from_effective_irradiance(eff)
1858+
<pvlib.modelchain.ModelChain ...>
18181859
18191860
Notes
18201861
-----
@@ -1853,6 +1894,7 @@ def run_model_from_effective_irradiance(self, data):
18531894
return self
18541895

18551896

1897+
18561898
def _irrad_for_celltemp(total_irrad, effective_irradiance):
18571899
"""
18581900
Determine irradiance to use for cell temperature models, in order

0 commit comments

Comments
 (0)