Skip to content

Commit 6868242

Browse files
committed
Minor documentation changes
1 parent ffc395b commit 6868242

File tree

3 files changed

+94
-88
lines changed

3 files changed

+94
-88
lines changed

windpowerlib/turbine_cluster_modelchain.py

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,52 +20,52 @@ class TurbineClusterModelChain(ModelChain):
2020
2121
Parameters
2222
----------
23-
power_plant : WindFarm or WindTurbineCluster
23+
power_plant : :class:`~.wind_farm.WindFarm` or :class:`~.wind_turbine_cluster.WindTurbineCluster`
2424
A :class:`~.wind_farm.WindFarm` object representing the wind farm or
2525
a :class:`~.wind_turbine_cluster.WindTurbineCluster` object
2626
representing the wind turbine cluster.
27-
wake_losses_model : string or None
27+
wake_losses_model : str or None
2828
Defines the method for taking wake losses within the farm into
2929
consideration. Options: None, 'power_efficiency_curve' or
3030
'constant_efficiency' or the name of a wind efficiency curve like
3131
'dena_mean'. Default: 'dena_mean'.
3232
Use :py:func:`~.wake_losses.get_wind_efficiency_curve` for all provided
3333
wind efficiency curves.
34-
smoothing : boolean
34+
smoothing : bool
3535
If True the power curves will be smoothed before or after the
3636
aggregation of power curves depending on `smoothing_order`.
3737
Default: False.
3838
block_width : float
3939
Width between the wind speeds in the sum of the equation in
4040
:py:func:`~.power_curves.smooth_power_curve`. Default: 0.5.
41-
standard_deviation_method : string
41+
standard_deviation_method : str
4242
Method for calculating the standard deviation for the Gauss
4343
distribution. Options: 'turbulence_intensity', 'Staffell_Pfenninger'.
4444
Default: 'turbulence_intensity'.
45-
smoothing_order : string
45+
smoothing_order : str
4646
Defines when the smoothing takes place if `smoothing` is True. Options:
4747
'turbine_power_curves' (to the single turbine power curves),
4848
'wind_farm_power_curves'. Default: 'wind_farm_power_curves'.
4949
5050
Other Parameters
5151
----------------
52-
wind_speed_model : string
52+
wind_speed_model : str
5353
Parameter to define which model to use to calculate the wind speed
5454
at hub height. Valid options are 'logarithmic', 'hellman' and
5555
'interpolation_extrapolation'.
56-
temperature_model : string
56+
temperature_model : str
5757
Parameter to define which model to use to calculate the temperature
5858
of air at hub height. Valid options are 'linear_gradient' and
5959
'interpolation_extrapolation'.
60-
density_model : string
60+
density_model : str
6161
Parameter to define which model to use to calculate the density of
6262
air at hub height. Valid options are 'barometric', 'ideal_gas' and
6363
'interpolation_extrapolation'.
64-
power_output_model : string
64+
power_output_model : str
6565
Parameter to define which model to use to calculate the turbine
6666
power output. Valid options are 'power_curve' and
6767
'power_coefficient_curve'.
68-
density_correction : boolean
68+
density_correction : bool
6969
If the parameter is True the density corrected power curve is used
7070
for the calculation of the turbine power output.
7171
obstacle_height : float
@@ -78,53 +78,54 @@ class TurbineClusterModelChain(ModelChain):
7878
7979
Attributes
8080
----------
81-
power_plant : WindFarm or WindTurbineCluster
81+
power_plant : :class:`~.wind_farm.WindFarm` or :class:`~.wind_turbine_cluster.WindTurbineCluster`
8282
A :class:`~.wind_farm.WindFarm` object representing the wind farm or
8383
a :class:`~.wind_turbine_cluster.WindTurbineCluster` object
8484
representing the wind turbine cluster.
85-
wake_losses_model : string or None
85+
wake_losses_model : str or None
8686
Defines the method for taking wake losses within the farm into
8787
consideration. Options: None, 'power_efficiency_curve' or
8888
'constant_efficiency' or the name of a wind efficiency curve like
8989
'dena_mean'. Default: 'dena_mean'.
9090
Use :py:func:`~.wake_losses.get_wind_efficiency_curve` for all provided
9191
wind efficiency curves.
92-
smoothing : boolean
92+
smoothing : bool
9393
If True the power curves will be smoothed before or after the
9494
aggregation of power curves depending on `smoothing_order`.
9595
Default: False.
9696
block_width : float
9797
Width between the wind speeds in the sum of the equation in
9898
:py:func:`~.power_curves.smooth_power_curve`. Default: 0.5.
99-
standard_deviation_method : string
99+
standard_deviation_method : str
100100
Method for calculating the standard deviation for the Gauss
101101
distribution. Options: 'turbulence_intensity', 'Staffell_Pfenninger'.
102102
Default: 'turbulence_intensity'.
103-
smoothing_order : string
103+
smoothing_order : str
104104
Defines when the smoothing takes place if `smoothing` is True. Options:
105105
'turbine_power_curves' (to the single turbine power curves),
106106
'wind_farm_power_curves'. Default: 'wind_farm_power_curves'.
107-
power_output : pandas.Series
107+
power_output : :pandas:`pandas.Series<series>`
108108
Electrical power output of the wind turbine in W.
109-
pandas.DataFrame or None
109+
#Todo fix!
110+
power_curve : :pandas:`pandas.Dataframe<frame>` or None
110111
The calculated power curve of the wind farm.
111-
wind_speed_model : string
112+
wind_speed_model : str
112113
Parameter to define which model to use to calculate the wind speed
113114
at hub height. Valid options are 'logarithmic', 'hellman' and
114115
'interpolation_extrapolation'.
115-
temperature_model : string
116+
temperature_model : str
116117
Parameter to define which model to use to calculate the temperature
117118
of air at hub height. Valid options are 'linear_gradient' and
118119
'interpolation_extrapolation'.
119-
density_model : string
120+
density_model : str
120121
Parameter to define which model to use to calculate the density of
121122
air at hub height. Valid options are 'barometric', 'ideal_gas' and
122123
'interpolation_extrapolation'.
123-
power_output_model : string
124+
power_output_model : str
124125
Parameter to define which model to use to calculate the turbine
125126
power output. Valid options are 'power_curve' and
126127
'power_coefficient_curve'.
127-
density_correction : boolean
128+
density_correction : bool
128129
If the parameter is True the density corrected power curve is used
129130
for the calculation of the turbine power output.
130131
obstacle_height : float

windpowerlib/wind_farm.py

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -20,50 +20,50 @@ class WindFarm(object):
2020
2121
Parameters
2222
----------
23-
name : string
23+
name : str or None
2424
Name of the wind farm.
25-
wind_turbine_fleet : list of dictionaries
25+
wind_turbine_fleet : list(dict)
2626
Wind turbines of wind farm. Dictionaries must have 'wind_turbine'
2727
(contains a :class:`~.wind_turbine.WindTurbine` object) and
2828
'number_of_turbines' (number of wind turbines of the same turbine type
2929
in the wind farm) as keys.
30-
coordinates : list or None
31-
List of coordinates [lat, lon] of location for loading data.
32-
Default: None.
33-
efficiency : float or pd.DataFrame
34-
Efficiency of the wind farm. Either constant (float) power efficiency
35-
curve (pd.DataFrame) containing 'wind_speed' and 'efficiency'
36-
columns/keys with wind speeds in m/s and the corresponding
30+
coordinates : list(float) or None (optional)
31+
List with coordinates [lat, lon] of location. Default: None.
32+
efficiency : float or :pandas:`pandas.DataFrame<frame>` or None (optional)
33+
Efficiency of the wind farm. Provide as either constant (float) or
34+
power efficiency curve (pd.DataFrame) containing 'wind_speed' and
35+
'efficiency' columns with wind speeds in m/s and the corresponding
3736
dimensionless wind farm efficiency. Default: None.
3837
3938
Attributes
4039
----------
41-
name : string
40+
name : str or None
4241
Name of the wind farm.
43-
wind_turbine_fleet : list of dictionaries
42+
wind_turbine_fleet : list(dict)
4443
Wind turbines of wind farm. Dictionaries must have 'wind_turbine'
4544
(contains a :class:`~.wind_turbine.WindTurbine` object) and
4645
'number_of_turbines' (number of wind turbines of the same turbine type
4746
in the wind farm) as keys.
48-
coordinates : list or None
49-
List of coordinates [lat, lon] of location for loading data.
50-
Default: None.
51-
efficiency : float or pd.DataFrame
47+
coordinates : list(float) or None
48+
List with coordinates [lat, lon] of location. Default: None.
49+
efficiency : float or :pandas:`pandas.DataFrame<frame>` or None
5250
Efficiency of the wind farm. Either constant (float) power efficiency
5351
curve (pd.DataFrame) containing 'wind_speed' and 'efficiency'
54-
columns/keys with wind speeds in m/s and the corresponding
52+
columns with wind speeds in m/s and the corresponding
5553
dimensionless wind farm efficiency. Default: None.
5654
hub_height : float
57-
The calculated mean hub height of the wind farm.
58-
power_curve : pandas.DataFrame or None
59-
The calculated power curve of the wind farm.
60-
power_output : pandas.Series
55+
The calculated mean hub height of the wind farm. See
56+
:py:func:`mean_hub_height` for more information.
6157
nominal_power : float
6258
The nominal power is the sum of the nominal power of all turbines in
6359
the wind farm in W.
6460
installed_power : float
6561
Installed nominal power of the wind farm in W. Deprecated! Use
6662
:attr:`~.wind_farm.WindFarm.nominal_power` instead.
63+
power_curve : :pandas:`pandas.DataFrame<frame>` or None
64+
The calculated power curve of the wind farm. See
65+
:py:func:`assign_power_curve` for more information.
66+
power_output : :pandas:`pandas.Series<series>`
6767
The calculated power output of the wind farm.
6868
6969
Examples
@@ -86,6 +86,7 @@ class WindFarm(object):
8686
25200000.0
8787
8888
"""
89+
8990
def __init__(self, name, wind_turbine_fleet, coordinates=None,
9091
efficiency=None, **kwargs):
9192

@@ -148,12 +149,14 @@ def mean_hub_height(self):
148149
The mean hub height of a wind farm is necessary for power output
149150
calculations with an aggregated wind farm power curve containing wind
150151
turbines with different hub heights. Hub heights of wind turbines with
151-
higher nominal power weigh more than others. Assigns the hub height to
152-
the wind farm object.
152+
higher nominal power weigh more than others.
153+
After the calculations the mean hub height is assigned to the attribute
154+
:py:attr:`~hub_height`.
153155
154156
Returns
155157
-------
156-
self
158+
:class:`~.wind_farm.WindFarm`
159+
self
157160
158161
Notes
159162
-----
@@ -211,27 +214,28 @@ def assign_power_curve(self, wake_losses_model='power_efficiency_curve',
211214
of all wind turbines in the wind farm. Depending on the parameters the
212215
power curves are smoothed (before or after the aggregation) and/or a
213216
wind farm efficiency (power efficiency curve or constant efficiency) is
214-
applied after the aggregation. After the calculations the power curve
215-
is assigned to the wind farm object.
217+
applied after the aggregation.
218+
After the calculations the power curve is assigned to the attribute
219+
:py:attr:`~power_curve`.
216220
217221
Parameters
218222
----------
219-
wake_losses_model : string
223+
wake_losses_model : str
220224
Defines the method for taking wake losses within the farm into
221225
consideration. Options: 'power_efficiency_curve',
222226
'constant_efficiency' or None. Default: 'power_efficiency_curve'.
223-
smoothing : boolean
227+
smoothing : bool
224228
If True the power curves will be smoothed before or after the
225229
aggregation of power curves depending on `smoothing_order`.
226230
Default: False.
227231
block_width : float
228232
Width between the wind speeds in the sum of the equation in
229233
:py:func:`~.power_curves.smooth_power_curve`. Default: 0.5.
230-
standard_deviation_method : string
234+
standard_deviation_method : str
231235
Method for calculating the standard deviation for the Gauss
232236
distribution. Options: 'turbulence_intensity',
233237
'Staffell_Pfenninger'. Default: 'turbulence_intensity'.
234-
smoothing_order : string
238+
smoothing_order : str
235239
Defines when the smoothing takes place if `smoothing` is True.
236240
Options: 'turbine_power_curves' (to the single turbine power
237241
curves), 'wind_farm_power_curves'.
@@ -240,17 +244,15 @@ def assign_power_curve(self, wake_losses_model='power_efficiency_curve',
240244
Turbulence intensity at hub height of the wind farm for power curve
241245
smoothing with 'turbulence_intensity' method. Can be calculated
242246
from `roughness_length` instead. Default: None.
243-
244-
Other Parameters
245-
----------------
246-
roughness_length : float, optional.
247+
roughness_length : float (optional)
247248
Roughness length. If `standard_deviation_method` is
248249
'turbulence_intensity' and `turbulence_intensity` is not given
249250
the turbulence intensity is calculated via the roughness length.
250251
251252
Returns
252253
-------
253-
self
254+
:class:`~.wind_farm.WindFarm`
255+
self
254256
255257
"""
256258
# Check if all wind turbines have a power curve as attribute
@@ -301,8 +303,8 @@ def assign_power_curve(self, wake_losses_model='power_efficiency_curve',
301303
standard_deviation_method=standard_deviation_method,
302304
block_width=block_width, **kwargs)
303305
else:
304-
# Add value zero to start and end of curve as otherwise there
305-
# can occure problems during the aggregation
306+
# Add value zero to start and end of curve as otherwise
307+
# problems can occur during the aggregation
306308
if power_curve.iloc[0]['wind_speed'] != 0.0:
307309
power_curve = pd.concat(
308310
[pd.DataFrame(data={
@@ -325,7 +327,8 @@ def assign_power_curve(self, wake_losses_model='power_efficiency_curve',
325327
df.interpolate(method='index').sum(axis=1))
326328
wind_farm_power_curve.columns = ['value']
327329
wind_farm_power_curve.reset_index('wind_speed', inplace=True)
328-
# Editions to the power curve after the summation
330+
# Apply power curve smoothing and consideration of wake losses
331+
# after the summation
329332
if smoothing and smoothing_order == 'wind_farm_power_curves':
330333
wind_farm_power_curve = power_curves.smooth_power_curve(
331334
wind_farm_power_curve['wind_speed'],

0 commit comments

Comments
 (0)