Skip to content

Commit fc7cd79

Browse files
committed
Move docstring example
1 parent ad6904f commit fc7cd79

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

windpowerlib/wind_turbine.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -169,21 +169,6 @@ def fetch_turbine_data(self, fetch_curve, data_source):
169169
>>> print(e126.nominal_power)
170170
4200000.0
171171
172-
>>> import os
173-
>>> source = os.path.join(os.path.dirname(__file__), '../example/data',
174-
... 'example_power_curves.csv')
175-
>>> example_turbine = {
176-
... 'hub_height': 100,
177-
... 'rotor_diameter': 70,
178-
... 'name': 'DUMMY 3',
179-
... 'fetch_curve': 'power_curve',
180-
... 'data_source': source}
181-
>>> e_t_1 = wind_turbine.WindTurbine(**example_turbine)
182-
>>> print(e_t_1.power_curve['power'][7])
183-
18000.0
184-
>>> print(e_t_1.nominal_power)
185-
150000
186-
187172
"""
188173

189174
def restructure_data():
@@ -281,8 +266,25 @@ def read_turbine_data(file_):
281266
turbines with turbine name in column 'turbine_type', turbine nominal
282267
power in column 'p_nom'.
283268
284-
"""
269+
Examples
270+
--------
271+
>>> from windpowerlib import wind_turbine
272+
>>> import os
273+
>>> source = os.path.join(os.path.dirname(__file__), '../example/data',
274+
... 'example_power_curves.csv')
275+
>>> example_turbine = {
276+
... 'hub_height': 100,
277+
... 'rotor_diameter': 70,
278+
... 'name': 'DUMMY 3',
279+
... 'fetch_curve': 'power_curve',
280+
... 'data_source': source}
281+
>>> e_t_1 = wind_turbine.WindTurbine(**example_turbine)
282+
>>> print(e_t_1.power_curve['power'][7])
283+
18000.0
284+
>>> print(e_t_1.nominal_power)
285+
150000
285286
287+
"""
286288
try:
287289
df = pd.read_csv(file_, index_col=0)
288290
except FileNotFoundError:

0 commit comments

Comments
 (0)