Skip to content

Commit 82964ab

Browse files
committed
Add to error raising
1 parent ee963ae commit 82964ab

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

windpowerlib/wake_losses.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,12 @@ def get_wind_efficiency_curve(curve_name='dena_mean'):
8787
p. 124
8888
8989
"""
90+
possible_curve_names = ['dena_mean', 'knorr_mean', 'dena_extreme1',
91+
'dena_extreme2', 'knorr_extreme1',
92+
'knorr_extreme2', 'knorr_extreme3']
9093
if curve_name.split('_')[0] not in ['dena', 'knorr']:
9194
raise ValueError("Wrong wind efficiency curve name. Must be one of " +
92-
"the following: 'dena_mean', 'knorr_mean' " + # TODO add names
95+
"the following: {}".format(possible_curve_names) +
9396
"but is {}".format(curve_name))
9497
path = os.path.join(os.path.dirname(__file__), 'data',
9598
'wind_efficiency_curves_{}.csv'.format(
@@ -99,8 +102,8 @@ def get_wind_efficiency_curve(curve_name='dena_mean'):
99102
# Raise error if wind efficiency curve specified in 'curve_name' does not
100103
# exist
101104
if curve_name not in list(wind_efficiency_curves):
102-
raise ValueError("Efficiency curve name does not exist. Must be " +
103-
"'dena_mean', 'knorr_mean' " + # TODO add names
105+
raise ValueError("Efficiency curve name does not exist. Must be one" +
106+
"of the following: {}".format(possible_curve_names) +
104107
"but is {}".format(curve_name))
105108
efficiency_curve = wind_efficiency_curves[['wind_speed', curve_name]]
106109
efficiency_curve.columns = ['wind_speed', 'efficiency']

0 commit comments

Comments
 (0)