Skip to content

Commit 0002bd0

Browse files
committed
clean up modelchain documentation
1 parent 1494117 commit 0002bd0

File tree

1 file changed

+63
-37
lines changed

1 file changed

+63
-37
lines changed

pvlib/modelchain.py

Lines changed: 63 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,63 @@ def basic_chain(times, latitude, longitude,
2222
airmass_model='kastenyoung1989',
2323
**kwargs):
2424
"""
25-
A function that computes all of the modeling steps necessary for
26-
calculating power or energy for a PV system at a given location.
25+
An experimental function that computes all of the modeling steps
26+
necessary for calculating power or energy for a PV system at a given
27+
location.
2728
2829
Parameters
2930
----------
30-
system : dict
31-
The connected set of modules, inverters, etc.
32-
keys must include latitude, longitude, module_parameters
33-
34-
location : dict
35-
The physical location at which to evaluate the model.
36-
3731
times : DatetimeIndex
3832
Times at which to evaluate the model.
3933
34+
latitude : float.
35+
Positive is north of the equator.
36+
Use decimal degrees notation.
37+
38+
longitude : float.
39+
Positive is east of the prime meridian.
40+
Use decimal degrees notation.
41+
42+
module_parameters : None, dict or Series
43+
Module parameters as defined by the SAPM, CEC, or other.
44+
45+
inverter_parameters : None, dict or Series
46+
Inverter parameters as defined by the SAPM, CEC, or other.
47+
48+
irradiance : None or DataFrame
49+
If None, calculates clear sky data.
50+
Columns must be 'dni', 'ghi', 'dhi'.
51+
52+
weather : None or DataFrame
53+
If None, assumes air temperature is 20 C and
54+
wind speed is 0 m/s.
55+
Columns must be 'wind_speed', 'temp_air'.
56+
57+
surface_tilt : float or Series
58+
Surface tilt angles in decimal degrees.
59+
The tilt angle is defined as degrees from horizontal
60+
(e.g. surface facing up = 0, surface facing horizon = 90)
61+
62+
surface_azimuth : float or Series
63+
Surface azimuth angles in decimal degrees.
64+
The azimuth convention is defined
65+
as degrees east of north
66+
(North=0, South=180, East=90, West=270).
67+
4068
orientation_strategy : None or str
4169
The strategy for aligning the modules.
4270
If not None, sets the ``surface_azimuth`` and ``surface_tilt``
4371
properties of the ``system``.
4472
45-
clearsky_model : str
46-
Passed to location.get_clearsky.
47-
4873
transposition_model : str
4974
Passed to system.get_irradiance.
5075
5176
solar_position_method : str
5277
Passed to location.get_solarposition.
5378
79+
airmass_model : str
80+
Passed to location.get_airmass.
81+
5482
**kwargs
5583
Arbitrary keyword arguments.
5684
See code for details.
@@ -154,27 +182,25 @@ def get_orientation(strategy, **kwargs):
154182

155183
class ModelChain(object):
156184
"""
157-
A class that represents all of the modeling steps necessary for
158-
calculating power or energy for a PV system at a given location.
159-
160-
Consider an abstract base class.
185+
An experimental class that represents all of the modeling steps
186+
necessary for calculating power or energy for a PV system at a given
187+
location.
161188
162189
Parameters
163190
----------
164191
system : PVSystem
165-
The connected set of modules, inverters, etc.
192+
A :py:class:`~pvlib.pvsystem.PVSystem` object that represents
193+
the connected set of modules, inverters, etc.
166194
167-
location : location
168-
The physical location at which to evaluate the model.
169-
170-
times : DatetimeIndex
171-
Times at which to evaluate the model.
195+
location : Location
196+
A :py:class:`~pvlib.location.Location` object that represents
197+
the physical location at which to evaluate the model.
172198
173199
orientation_strategy : None or str
174-
The strategy for aligning the modules.
175-
If not None, sets the ``surface_azimuth`` and ``surface_tilt``
176-
properties of the ``system``.
177-
Allowed strategies include 'flat', 'south_at_latitude_tilt'.
200+
The strategy for aligning the modules. If not None, sets the
201+
``surface_azimuth`` and ``surface_tilt`` properties of the
202+
``system``. Allowed strategies include 'flat',
203+
'south_at_latitude_tilt'.
178204
179205
clearsky_model : str
180206
Passed to location.get_clearsky.
@@ -185,14 +211,12 @@ class ModelChain(object):
185211
solar_position_method : str
186212
Passed to location.get_solarposition.
187213
214+
airmass_model : str
215+
Passed to location.get_airmass.
216+
188217
**kwargs
189218
Arbitrary keyword arguments.
190219
Included for compatibility, but not used.
191-
192-
See also
193-
--------
194-
location.Location
195-
pvsystem.PVSystem
196220
"""
197221

198222
def __init__(self, system, location,
@@ -235,18 +259,22 @@ def run_model(self, times, irradiance=None, weather=None):
235259
Parameters
236260
----------
237261
times : DatetimeIndex
262+
Times at which to evaluate the model.
263+
238264
irradiance : None or DataFrame
239265
If None, calculates clear sky data.
240-
Columns must be 'dni', 'ghi', 'dhi'
266+
Columns must be 'dni', 'ghi', 'dhi'.
267+
241268
weather : None or DataFrame
242269
If None, assumes air temperature is 20 C and
243270
wind speed is 0 m/s.
244271
Columns must be 'wind_speed', 'temp_air'.
245272
246273
Returns
247274
-------
248-
output : DataFrame
249-
Some combination of AC power, DC power, POA irrad, etc.
275+
output : (ac, dc)
276+
Tuple of AC power (Series) and DC power with SAPM parameters
277+
(DataFrame).
250278
251279
Assigns attributes: times, solar_position, airmass, irradiance,
252280
total_irrad, weather, temps, aoi, dc, ac
@@ -294,7 +322,6 @@ def run_model(self, times, irradiance=None, weather=None):
294322

295323
return self.dc, self.ac
296324

297-
298325
def model_system(self):
299326
"""
300327
Model the system?
@@ -311,7 +338,6 @@ def model_system(self):
311338
modeling_steps = self.get_modeling_steps()
312339

313340

314-
315341
class MoreSpecificModelChain(ModelChain):
316342
"""
317343
Something more specific.
@@ -321,4 +347,4 @@ def __init__(self, *args, **kwargs):
321347

322348
def run_model(self):
323349
# overrides the parent ModelChain method
324-
pass
350+
pass

0 commit comments

Comments
 (0)