Skip to content

Commit 3e3ea07

Browse files
committed
Remove unrelated modelchain changes
1 parent f79d3fe commit 3e3ea07

1 file changed

Lines changed: 17 additions & 68 deletions

File tree

pvlib/modelchain.py

Lines changed: 17 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,22 @@
2020

2121
from pvlib._deprecation import deprecated
2222

23-
# Keys used to detect input data and assign values to the appropriate
24-
# ModelChain attributes.
25-
26-
# Weather-related input columns for ModelChain.weather
27-
WEATHER_KEYS = (
28-
'ghi', # Global Horizontal Irradiance (W/m^2)
29-
'dhi', # Diffuse Horizontal Irradiance (W/m^2)
30-
'dni', # Direct Normal Irradiance (W/m^2)
31-
'wind_speed', # Wind speed (m/s)
32-
'temp_air', # Ambient air temperature (°C)
33-
'precipitable_water' # Column precipitable water (cm)
34-
)
35-
36-
# Plane-of-array irradiance input columns for ModelChain.total_irrad
37-
POA_KEYS = (
38-
'poa_global', # Total plane-of-array irradiance (W/m^2)
39-
'poa_direct', # Direct POA irradiance (W/m^2)
40-
'poa_diffuse' # Diffuse POA irradiance (W/m^2)
41-
)
23+
# keys that are used to detect input data and assign data to appropriate
24+
# ModelChain attribute
25+
# for ModelChain.weather
26+
WEATHER_KEYS = ('ghi', 'dhi', 'dni', 'wind_speed', 'temp_air',
27+
'precipitable_water')
28+
29+
# for ModelChain.total_irrad
30+
POA_KEYS = ('poa_global', 'poa_direct', 'poa_diffuse')
31+
32+
# Optional keys to communicate temperature data. If provided,
33+
# 'cell_temperature' overrides ModelChain.temperature_model and sets
34+
# ModelChain.cell_temperature to the data. If 'module_temperature' is provided,
35+
# overrides ModelChain.temperature_model with
36+
# pvlib.temperature.sapm_cell_from_module
37+
TEMPERATURE_KEYS = ('module_temperature', 'cell_temperature')
4238

43-
# Temperature-related optional input columns for ModelChain
44-
TEMPERATURE_KEYS = (
45-
'module_temperature', # Back-surface module temperature (°C)
46-
'cell_temperature', # Direct cell temperature input (°C)
47-
)
48-
49-
# All supported input keys combined
5039
DATA_KEYS = WEATHER_KEYS + POA_KEYS + TEMPERATURE_KEYS
5140

5241
# these dictionaries contain the default configuration for following
@@ -1724,27 +1713,6 @@ def run_model_from_poa(self, data):
17241713
of Arrays in the PVSystem.
17251714
ValueError
17261715
If the DataFrames in `data` have different indexes.
1727-
Examples
1728-
--------
1729-
Single-array system:
1730-
1731-
>>> import pandas as pd
1732-
>>> from pvlib.pvsystem import PVSystem
1733-
>>> from pvlib.location import Location
1734-
>>> from pvlib.modelchain import ModelChain
1735-
>>>
1736-
>>> system = PVSystem(module_parameters={'pdc0': 300})
1737-
>>> location = Location(35, -110)
1738-
>>> mc = ModelChain(system, location)
1739-
>>>
1740-
>>> poa = pd.DataFrame({
1741-
... 'poa_global': [900, 850],
1742-
... 'poa_direct': [600, 560],
1743-
... 'poa_diffuse': [300, 290],
1744-
... }, index=pd.date_range("2021-06-01", periods=2, freq="H"))
1745-
>>>
1746-
>>> mc.run_model_from_poa(poa)
1747-
<pvlib.modelchain.ModelChain ...>
17481716
17491717
Notes
17501718
-----
@@ -1770,6 +1738,7 @@ def run_model_from_poa(self, data):
17701738
self._run_from_effective_irrad(data)
17711739

17721740
return self
1741+
17731742
def _run_from_effective_irrad(self, data):
17741743
"""
17751744
Executes the temperature, DC, losses and AC models.
@@ -1788,7 +1757,7 @@ def _run_from_effective_irrad(self, data):
17881757
17891758
Notes
17901759
-----
1791-
Assigns attributes:``cell_temperature, 'dc', ``ac', ``losses``,
1760+
Assigns attributes:``cell_temperature``, ``dc``, ``ac``, ``losses``,
17921761
``diode_params`` (if dc_model is a single diode model).
17931762
"""
17941763
self._prepare_temperature(data)
@@ -1829,25 +1798,6 @@ def run_model_from_effective_irradiance(self, data):
18291798
of Arrays in the PVSystem.
18301799
ValueError
18311800
If the DataFrames in `data` have different indexes.
1832-
Examples
1833-
--------
1834-
>>> import pandas as pd
1835-
>>> from pvlib.pvsystem import PVSystem
1836-
>>> from pvlib.location import Location
1837-
>>> from pvlib.modelchain import ModelChain
1838-
>>>
1839-
>>> system = PVSystem(module_parameters={'pdc0': 300})
1840-
>>> location = Location(35, -110)
1841-
>>> mc = ModelChain(system, location)
1842-
>>>
1843-
>>> eff = pd.DataFrame({
1844-
... 'effective_irradiance': [900, 920],
1845-
... 'temp_air': [25, 24],
1846-
... 'wind_speed': [2.0, 1.5],
1847-
... })
1848-
>>>
1849-
>>> mc.run_model_from_effective_irradiance(eff)
1850-
<pvlib.modelchain.ModelChain ...>
18511801
18521802
Notes
18531803
-----
@@ -1886,7 +1836,6 @@ def run_model_from_effective_irradiance(self, data):
18861836
return self
18871837

18881838

1889-
18901839
def _irrad_for_celltemp(total_irrad, effective_irradiance):
18911840
"""
18921841
Determine irradiance to use for cell temperature models, in order

0 commit comments

Comments
 (0)