Skip to content

Commit 376c284

Browse files
committed
Add to docstrings
1 parent 2bcc302 commit 376c284

File tree

5 files changed

+24
-12
lines changed

5 files changed

+24
-12
lines changed

windpowerlib/power_curves.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
The ``power_curves`` module contains functions for applying alterations like
3-
power curve smoohting or reducing power values by an efficiency to the power
3+
power curve smoothing or reducing power values by an efficiency to the power
44
curve of a wind turbine, wind farm or wind turbine cluster.
55
66
"""
@@ -18,7 +18,7 @@ def smooth_power_curve(power_curve_wind_speeds, power_curve_values,
1818
standard_deviation_method='turbulence_intensity',
1919
mean_gauss=0, **kwargs):
2020
r"""
21-
Smoothes the input power curve values by using a Gauss distribution.
21+
Smooths the input power curve values by using a Gauss distribution.
2222
2323
Parameters
2424
----------
@@ -29,8 +29,8 @@ def smooth_power_curve(power_curve_wind_speeds, power_curve_values,
2929
Power curve values corresponding to wind speeds in
3030
`power_curve_wind_speeds`.
3131
block_width : float
32-
Width between the wind speeds in the sum of the equation shown below in
33-
Notes. Default: 0.5.
32+
Width between the wind speeds in the sum of equation :eq:`power`.
33+
Default: 0.5.
3434
wind_speed_range : float
3535
The sum in the equation below is taken for this wind speed range below
3636
and above the power curve wind speed. Default: 15.0.
@@ -39,7 +39,7 @@ def smooth_power_curve(power_curve_wind_speeds, power_curve_values,
3939
distribution. Options: 'turbulence_intensity', 'Staffell_Pfenninger'.
4040
Default: 'turbulence_intensity'.
4141
mean_gauss : float
42-
Mean of the Gaus distribution in
42+
Mean of the Gauss distribution in
4343
:py:func:`~.tools.gauss_distribution`. Default: 0.
4444
4545
Other Parameters
@@ -58,18 +58,20 @@ def smooth_power_curve(power_curve_wind_speeds, power_curve_values,
5858
-----
5959
The following equation is used to calculated the power curves values of the
6060
smoothed power curve [1]_:
61+
6162
.. math:: P_{smoothed}(v_{std}) = \sum\limits_{v_i} \Delta v_i \cdot P(v_i)
6263
\cdot \frac{1}{\sigma \sqrt{2 \pi}}
6364
\exp \left[-\frac{(v_{std} - v_i -\mu)^2}{2 \sigma^2} \right]
65+
:label: power
6466
6567
with:
6668
P: power [W], v: wind speed [m/s],
67-
:math:`\sigma`: standard deviation (Gauss), :math: `\mu`: mean (Gauss)
69+
:math:`\sigma`: standard deviation (Gauss), :math:`\mu`: mean (Gauss)
6870
6971
:math:`P_{smoothed}` is the smoothed power curve value,
7072
:math:`v_{std}` is the standard wind speed in the power curve,
7173
:math: `\Delta v_i` is the interval length between
72-
:math: `$v_\text{i}$` and :math: `$v_\text{i+1}$`
74+
:math: `v_\text{i}` and :math: `v_\text{i+1}`
7375
7476
Power curve smoothing is applied to take account for the spatial
7577
distribution of wind speed. This way of smoothing power curves is also used

windpowerlib/tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def gauss_distribution(function_variable, standard_deviation, mean=0):
173173

174174

175175
def estimate_turbulence_intensity(height, roughness_length):
176-
"""
176+
r"""
177177
Estimate turbulence intensity by the roughness length.
178178
179179
Parameters
@@ -188,7 +188,7 @@ def estimate_turbulence_intensity(height, roughness_length):
188188
-----
189189
The following equation is used [1]_:
190190
191-
.. math:: TI = \frac{1}{\ln\left( \frac{h}{z_0} \right)}
191+
.. math:: TI = \frac{1}{\ln\left(\frac{h}{z_\text{0}}\right)}
192192
193193
with:
194194
TI: turbulence intensity, h: height, :math:`z_{0}`: roughness length

windpowerlib/wake_losses.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
def reduce_wind_speed(wind_speed, wind_efficiency_curve_name='dena_mean'):
21-
"""
21+
r"""
2222
Reduces wind speed by a wind efficiency curve.
2323
2424
The wind efficiency curves are provided in the windpowerlib and were
@@ -79,7 +79,7 @@ def get_wind_efficiency_curve(curve_name='dena_mean'):
7979
Notes
8080
-----
8181
The wind efficiency curves were generated in the "Dena Netzstudie" and in
82-
the disseration of Kaspar Knorr. For more information see [1]_ and [2]_.
82+
the dissertation of Kaspar Knorr. For more information see [1]_ and [2]_.
8383
8484
References
8585
----------
@@ -124,7 +124,7 @@ def display_wind_efficiency_curves():
124124
Notes
125125
-----
126126
The wind efficiency curves were generated in the "Dena Netzstudie" and in
127-
the disseration of Kaspar Knorr. For more information see [1]_ and [2]_.
127+
the dissertation of Kaspar Knorr. For more information see [1]_ and [2]_.
128128
129129
References
130130
----------
@@ -165,5 +165,6 @@ def display_wind_efficiency_curves():
165165
print(dena_df)
166166
print(knorr_df)
167167

168+
168169
if __name__ == "__main__":
169170
display_wind_efficiency_curves()

windpowerlib/wind_farm.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ def assign_power_curve(self, wake_losses_model='power_efficiency_curve',
172172
Options: 'turbine_power_curves' (to the single turbine power
173173
curves), 'wind_farm_power_curves'.
174174
Default: 'wind_farm_power_curves'.
175+
turbulence_intensity : float
176+
Turbulence intensity at hub height of the wind farm for power curve
177+
smoothing with 'turbulence_intensity' method. Can be calculated
178+
from `roughness_length` instead. Default: None.
175179
176180
Other Parameters
177181
----------------

windpowerlib/wind_turbine_cluster.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ def assign_power_curve(self, wake_losses_model='power_efficiency_curve',
145145
Options: 'turbine_power_curves' (to the single turbine power
146146
curves), 'wind_farm_power_curves'.
147147
Default: 'wind_farm_power_curves'.
148+
turbulence_intensity : float
149+
Turbulence intensity at hub height of the wind farm or
150+
wind turbine cluster for power curve smoothing with
151+
'turbulence_intensity' method. Can be calculated from
152+
`roughness_length` instead. Default: None.
148153
149154
Other Parameters
150155
----------------

0 commit comments

Comments
 (0)