Skip to content

Commit 790b6f8

Browse files
committed
Add deprecation warning for decprecated function parameter
1 parent 5c70526 commit 790b6f8

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

windpowerlib/power_curves.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import numpy as np
1212
import pandas as pd
1313
from windpowerlib import tools
14+
import warnings
1415

1516

1617
def smooth_power_curve(power_curve_wind_speeds, power_curve_values,
@@ -204,6 +205,9 @@ def wake_losses_to_power_curve(power_curve_wind_speeds, power_curve_values,
204205
and the corresponding power curve value in W.
205206
206207
"""
208+
warnings.warn(
209+
'wake_losses_model is deprecated.',
210+
FutureWarning)
207211
# Create power curve DataFrame
208212
power_curve_df = pd.DataFrame(
209213
data=[list(power_curve_wind_speeds),

windpowerlib/wind_turbine.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ def isfloat(x):
246246
df = pd.read_csv(file_, index_col=0)
247247
except FileNotFoundError:
248248
raise FileNotFoundError("The file '{}' was not found.".format(file_))
249-
# todo: note: this try except statement will be removed in 0.2.0 and only
250-
# the exception will stay. The example power (coefficient) curve files
251-
# will then be adapted
249+
# note: this try except statement will be removed in 0.2.0 and only
250+
# the exception will stay. The example power (coefficient) curve files
251+
# will then be adapted
252252
try:
253253
wpp_df = df[df['turbine_id'] == turbine_type]
254254
except KeyError:
@@ -267,9 +267,9 @@ def isfloat(x):
267267
df = curve_data.transpose().reset_index()
268268
df.columns = ['wind_speed', 'value']
269269
df['wind_speed'] = df['wind_speed'].apply(lambda x: float(x))
270-
# todo: note: this try except statement will be removed in 0.2.0 and only
271-
# the exception will stay. The example power (coefficient) curve files
272-
# will then be adapted
270+
# note: this try except statement will be removed in 0.2.0 and only
271+
# the exception will stay. The example power (coefficient) curve files
272+
# will then be adapted
273273
try:
274274
nominal_power = wpp_df['p_nom'].iloc[0]
275275
except KeyError:

0 commit comments

Comments
 (0)