Skip to content

Commit 2e868b5

Browse files
committed
Remove separate logging message within error message.
If the error message was catched the logging message still was logged and was kind of confusing without the error message. Now both or None of them is shown.
1 parent 974f122 commit 2e868b5

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

windpowerlib/wind_turbine.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,8 @@ def get_turbine_data_from_file(turbine_type, path):
250250
wpp_df = df[df.index == turbine_type].copy()
251251
# if turbine not in data file
252252
if wpp_df.shape[0] == 0:
253-
pd.set_option('display.max_rows', len(df))
254-
logging.info('Possible types: \n{0}'.format(pd.DataFrame(df.index)))
255-
pd.reset_option('display.max_rows')
256-
raise KeyError("Wind converter type {0} not provided.".format(
257-
turbine_type))
253+
msg = "Wind converter type {0} not provided. Possible types: {1}"
254+
raise KeyError(msg.format(turbine_type, list(df.index)))
258255
# if turbine in data file
259256
# get nominal power or power (coefficient) curve
260257
if 'turbine_data' in path:

0 commit comments

Comments
 (0)