Skip to content

Commit 1c2bdbe

Browse files
committed
Implement better error message
1 parent 53d5f0c commit 1c2bdbe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

windpowerlib/wind_turbine.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,11 @@ def get_oedb_turbine_data(turbine_type, fetch_data):
359359
wind speeds in m/s in column 'wind_speed'.
360360
361361
"""
362+
# raise error if no turbine type is provided
363+
if turbine_type is None:
364+
raise ValueError("Please provide wind turbine type to fetch {} from "
365+
"oedb turbine library.".format(fetch_data))
366+
362367
if fetch_data == 'nominal_power':
363368
filename = os.path.join(os.path.dirname(__file__), 'data',
364369
'oedb_turbine_data.csv')

0 commit comments

Comments
 (0)