Skip to content

Commit 9287010

Browse files
committed
Merge branch 'dev' into make_windpowerlib_work_offline
2 parents 9635b3b + 0a386a1 commit 9287010

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

doc/whats_new.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ These are new features and improvements of note in each release
88
:local:
99
:backlinks: top
1010

11+
.. include:: whatsnew/v0-1-2.txt
1112
.. include:: whatsnew/v0-1-1.txt
1213
.. include:: whatsnew/v0-1-0.txt
1314
.. include:: whatsnew/v006.txt

windpowerlib/wake_losses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def get_wind_efficiency_curve(curve_name='all'):
121121
curve_names = curve_name
122122

123123
efficiency_curve = pd.DataFrame(columns=pd.MultiIndex(levels=[[], []],
124-
labels=[[], []]))
124+
codes=[[], []]))
125125

126126
for curve_name in curve_names:
127127
if curve_name.split('_')[0] not in ['dena', 'knorr']:

windpowerlib/wind_farm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,14 @@ def assign_power_curve(self, wake_losses_model='power_efficiency_curve',
264264
power_curve = pd.concat(
265265
[pd.DataFrame(data={
266266
'value': [0.0], 'wind_speed': [0.0]}),
267-
power_curve])
267+
power_curve], sort=True)
268268
if power_curve.iloc[-1]['value'] != 0.0:
269269
power_curve = pd.concat(
270270
[power_curve, pd.DataFrame(data={
271271
'value': [0.0], 'wind_speed': [
272272
power_curve['wind_speed'].loc[
273-
power_curve.index[-1]] + 0.5]})])
273+
power_curve.index[-1]] + 0.5]})],
274+
sort=True)
274275
# Add power curves of all turbine types to data frame
275276
# (multiplied by turbine amount)
276277
df = pd.concat(

windpowerlib/wind_turbine.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def isfloat(x):
238238
try:
239239
float(x)
240240
return x
241-
except:
241+
except ValueError:
242242
return False
243243

244244
try:
@@ -337,8 +337,8 @@ def load_turbine_data_from_oedb():
337337
oep_url + '/api/v0/schema/{}/tables/{}/rows/?'.format(
338338
schema, table), )
339339
if not result.status_code == 200:
340-
raise ConnectionError("Database connection not successful. " +
341-
"Error: ".format(result.status_code))
340+
raise ConnectionError("Database connection not successful. "
341+
"Error: {}".format(result.status_code))
342342
# extract data
343343
turbine_data = pd.DataFrame(result.json())
344344
return turbine_data
@@ -387,9 +387,9 @@ def get_turbine_types(print_out=True):
387387
"""
388388

389389
df = load_turbine_data_from_oedb()
390-
cp_curves_df = df.iloc[df.loc[df['has_cp_curve'] == True].index][
390+
cp_curves_df = df.iloc[df.loc[df['has_cp_curve']].index][
391391
['manufacturer', 'turbine_type', 'has_cp_curve']]
392-
p_curves_df = df.iloc[df.loc[df['has_power_curve'] == True].index][
392+
p_curves_df = df.iloc[df.loc[df['has_power_curve']].index][
393393
['manufacturer', 'turbine_type', 'has_power_curve']]
394394
curves_df = pd.merge(p_curves_df, cp_curves_df, how='outer',
395395
sort=True).fillna(False)

0 commit comments

Comments
 (0)