Skip to content

Commit 536e30a

Browse files
committed
Renam not consistent parameters and keys
1 parent 7349e4f commit 536e30a

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

example/basic_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def initialise_wind_turbines():
9797
# specification of own wind turbine (Note: power coefficient values and
9898
# nominal power have to be in Watt)
9999
myTurbine = {
100-
'turbine_name': 'myTurbine',
100+
'object_name': 'myTurbine',
101101
'nominal_power': 3e6, # in W
102102
'hub_height': 105, # in m
103103
'rotor_diameter': 90, # in m
@@ -113,7 +113,7 @@ def initialise_wind_turbines():
113113
# if you want to use the power coefficient curve change the value of
114114
# 'fetch_curve' to 'power_coefficient_curve'
115115
enerconE126 = {
116-
'turbine_name': 'ENERCON E 126 7500', # turbine name as in register
116+
'object_name': 'ENERCON E 126 7500', # turbine name as in register
117117
'hub_height': 135, # in m
118118
'rotor_diameter': 127, # in m
119119
'fetch_curve': 'power_curve' # fetch power curve

windpowerlib/wind_turbine.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class WindTurbine(object):
3131
Diameter of the rotor in m.
3232
power_coefficient_curve : None, pandas.DataFrame or dictionary
3333
Power coefficient curve of the wind turbine. DataFrame/dictionary must
34-
have 'wind_speed' and 'values' columns/keys with wind speeds in m/s
35-
and the corresponding power coefficients. Default: None.
34+
have 'wind_speed' and 'power_coefficient' columns/keys with wind speeds
35+
in m/s and the corresponding power coefficients. Default: None.
3636
power_curve : None, pandas.DataFrame or dictionary
3737
Power curve of the wind turbine. DataFrame/dictionary must have
3838
'wind_speed' and 'values' columns/keys with wind speeds in m/s and the
@@ -56,11 +56,11 @@ class WindTurbine(object):
5656
Diameter of the rotor in m.
5757
power_coefficient_curve : None, pandas.DataFrame or dictionary
5858
Power coefficient curve of the wind turbine. DataFrame/dictionary must
59-
have 'wind_speed' and 'values' columns/keys with wind speeds in m/s
60-
and the corresponding power coefficients. Default: None.
59+
have 'wind_speed' and 'power coefficient' columns/keys with wind speeds
60+
in m/s and the corresponding power coefficients. Default: None.
6161
power_curve : None, pandas.DataFrame or dictionary
6262
Power curve of the wind turbine. DataFrame/dictionary must have
63-
'wind_speed' and 'values' columns/keys with wind speeds in m/s and the
63+
'wind_speed' and 'power' columns/keys with wind speeds in m/s and the
6464
corresponding power curve value in W. Default: None.
6565
nominal_power : None or float
6666
The nominal output of the wind turbine in W.
@@ -92,7 +92,7 @@ class WindTurbine(object):
9292
9393
"""
9494

95-
def __init__(self, turbine_name, hub_height, rotor_diameter=None,
95+
def __init__(self, object_name, hub_height, rotor_diameter=None,
9696
power_coefficient_curve=None, power_curve=None,
9797
nominal_power=None, fetch_curve=None):
9898

@@ -135,7 +135,7 @@ def fetch_turbine_data(self):
135135
... 'object_name': 'ENERCON E 126 7500',
136136
... 'fetch_curve': 'power_coefficient_curve'}
137137
>>> e126 = wind_turbine.WindTurbine(**enerconE126)
138-
>>> print(e126.power_coefficient_curve['values'][5])
138+
>>> print(e126.power_coefficient_curve['power coefficient'][5])
139139
0.423
140140
>>> print(e126.nominal_power)
141141
7500000
@@ -179,7 +179,11 @@ def restructure_data():
179179
data = np.vstack((data, np.array(
180180
[float(col), float(wpp_df[col])])))
181181
data = np.delete(data, 0, 0)
182-
df = pd.DataFrame(data, columns=['wind_speed', 'values'])
182+
if self.fetch_curve == 'power_curve':
183+
df = pd.DataFrame(data, columns=['wind_speed', 'power'])
184+
if self.fetch_curve == 'power_coefficient_curve':
185+
df = pd.DataFrame(data, columns=['wind_speed',
186+
'power coefficient'])
183187
nominal_power = wpp_df['p_nom'].iloc[0]
184188
return df, nominal_power
185189
if self.fetch_curve == 'power_curve':

0 commit comments

Comments
 (0)