Skip to content

Commit 6a86065

Browse files
committed
Move check where it belongs
1 parent dd01a20 commit 6a86065

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

windpowerlib/wind_turbine.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ def __init__(self, hub_height, power_curve=False,
202202
else:
203203
self.power_coefficient_curve = None
204204

205+
# test if either power curve or power coefficient curve is assigned
206+
if power_curve is False and power_coefficient_curve is False:
207+
raise AttributeError(
208+
"Wind turbine must either have a power curve "
209+
"or power coefficient curve.")
210+
205211
if nominal_power is not False:
206212
# if True get nominal power from oedb turbine library
207213
if nominal_power is True:
@@ -232,10 +238,6 @@ def __init__(self, hub_height, power_curve=False,
232238
except KeyError:
233239
pass
234240

235-
# test if either power curve or power coefficient curve is assigned
236-
if power_curve is False and power_coefficient_curve is False:
237-
raise AttributeError("Wind turbine must either have a power curve "
238-
"or power coefficient curve.")
239241

240242
def __repr__(self):
241243
info = []

0 commit comments

Comments
 (0)