Skip to content

Commit 2606bd5

Browse files
committed
Fix comment and move oedb example up to make it more prominent
1 parent e33cc2b commit 2606bd5

File tree

2 files changed

+21
-49
lines changed

2 files changed

+21
-49
lines changed

example/modelchain_example.ipynb

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
"source": [
158158
"To initialize a specific turbine you need a dictionary that contains the basic parameters. A turbine is defined by its nominal power, hub height, rotor diameter, and power or power coefficient curve.\n",
159159
"\n",
160-
"There are three ways to initialize a WindTurbine object in the windpowerlib. You can either specify your own turbine, as done below for 'my_turbine', or fetch power and/or power coefficient curve data from data files provided by the windpowerlib, as done for the 'enercon_e126', or provide your turbine data in csv files as done for the 'dummy_turbine' with an example file.\n",
160+
"There are three ways to initialize a WindTurbine object in the windpowerlib. You can either use turbine data from the OpenEnergy Database (oedb) turbine library that is provided along with the windpowerlib, as done for the 'enercon_e126', or specify your own turbine by directly providing a power (coefficient) curve, as done below for 'my_turbine', or provide your own turbine data in csv files, as done for 'dummy_turbine'.\n",
161161
"\n",
162162
"You can execute the following to get a table of all wind turbines for which power and/or power coefficient curves are provided."
163163
]
@@ -228,28 +228,6 @@
228228
"print(df[df[\"turbine_type\"].str.contains(\"E-101\")])"
229229
]
230230
},
231-
{
232-
"cell_type": "code",
233-
"execution_count": 33,
234-
"metadata": {},
235-
"outputs": [],
236-
"source": [
237-
"# specification of own wind turbine (Note: power coefficient values and\n",
238-
"# nominal power have to be in Watt)\n",
239-
"my_turbine = {\n",
240-
" 'name': 'myTurbine',\n",
241-
" 'nominal_power': 3e6, # in W\n",
242-
" 'hub_height': 105, # in m\n",
243-
" 'rotor_diameter': 90, # in m\n",
244-
" 'power_curve': pd.DataFrame(\n",
245-
" data={'value': [p * 1000 for p in [\n",
246-
" 0.0, 26.0, 180.0, 1500.0, 3000.0, 3000.0]], # in W\n",
247-
" 'wind_speed': [0.0, 3.0, 5.0, 10.0, 15.0, 25.0]}) # in m/s\n",
248-
" } \n",
249-
"# initialisze WindTurbine object\n",
250-
"my_turbine = WindTurbine(**my_turbine)"
251-
]
252-
},
253231
{
254232
"cell_type": "code",
255233
"execution_count": 6,
@@ -270,13 +248,10 @@
270248
"source": [
271249
"# specification of wind turbine where power curve is provided in the \n",
272250
"# oedb turbine library\n",
273-
"# if you want to use the power coefficient curve change the value of\n",
274-
"# 'power_coefficient_curve' to 'oedb'.\n",
251+
"\n",
275252
"enercon_e126 = {\n",
276253
" 'turbine_type': 'E-126/4200', # turbine type as in oedb turbine library\n",
277-
" 'hub_height': 135, # in m\n",
278-
" 'rotor_diameter': 127, # in m (only needs to be provided when calculating the power \n",
279-
" # output using the power coefficient curve)\n",
254+
" 'hub_height': 135 # in m\n",
280255
" }\n",
281256
"# initialize WindTurbine object\n",
282257
"e126 = WindTurbine(**enercon_e126)"

example/modelchain_example.py

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ def initialize_wind_turbines():
9494
Initializes three :class:`~.wind_turbine.WindTurbine` objects.
9595
9696
This function shows three ways to initialize a WindTurbine object. You can
97-
either specify your own turbine by directly providing a power (coefficient)
98-
curve, as done below for 'my_turbine', or provide your own turbine data in
99-
csv files as done for 'dummy_turbine', or you can use power and/or power
100-
coefficient curve data from the OpenEnergy Database
101-
(oedb) turbine library that is provided along with the windpowerlib,
102-
as done for the 'enercon_e126'. Execute
103-
``windpowerlib.wind_turbine.get_turbine_types()`` to get a table
104-
including all wind turbines for which power and/or power coefficient curves
105-
are provided.
97+
either use turbine data from the OpenEnergy Database (oedb) turbine library
98+
that is provided along with the windpowerlib, as done for the
99+
'enercon_e126', or specify your own turbine by directly providing a power
100+
(coefficient) curve, as done below for 'my_turbine', or provide your own
101+
turbine data in csv files, as done for 'dummy_turbine'.
102+
103+
To get a list of all wind turbines for which power and/or power coefficient
104+
curves are provided execute `
105+
`windpowerlib.wind_turbine.get_turbine_types()``.
106106
107107
Returns
108108
-------
@@ -112,6 +112,15 @@ def initialize_wind_turbines():
112112
113113
"""
114114

115+
# specification of wind turbine where data is provided in the oedb
116+
# turbine library
117+
enercon_e126 = {
118+
'turbine_type': 'E-126/4200', # turbine type as in register
119+
'hub_height': 135 # in m
120+
}
121+
# initialize WindTurbine object
122+
e126 = WindTurbine(**enercon_e126)
123+
115124
# specification of own wind turbine (Note: power values and nominal power
116125
# have to be in Watt)
117126
my_turbine = {
@@ -137,18 +146,6 @@ def initialize_wind_turbines():
137146
# initialize WindTurbine object
138147
dummy_turbine = WindTurbine(**dummy_turbine)
139148

140-
# specification of wind turbine where power curve is provided in the oedb
141-
# turbine library
142-
# if you want to use the power coefficient curve change the value of
143-
# 'power_coefficient_curve' to True.
144-
enercon_e126 = {
145-
'turbine_type': 'E-126/4200', # turbine type as in register
146-
'hub_height': 135, # in m
147-
'rotor_diameter': 127, # in m
148-
}
149-
# initialize WindTurbine object
150-
e126 = WindTurbine(**enercon_e126)
151-
152149
return my_turbine, e126, dummy_turbine
153150

154151

0 commit comments

Comments
 (0)