Skip to content

Commit e63b5fd

Browse files
Birgit SchachlerBirgit Schachler
authored andcommitted
Rename P in power curve dataframe to p to make it more consistent
1 parent 636b905 commit e63b5fd

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

windpowerlib/power_output.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def p_curve(p_values, v_wind):
129129
p_values : pandas.DataFrame
130130
Power curve of the wind turbine.
131131
Indices are the wind speeds of the power curve in m/s, the
132-
corresponding power values are in the column 'P'.
132+
corresponding power values in W are in the column 'p'.
133133
v_wind : pandas.Series or array
134134
Wind speed at hub height in m/s.
135135
@@ -172,7 +172,7 @@ def p_curve_density_corr(v_wind, rho_hub, p_values):
172172
p_values : pandas.DataFrame
173173
Power curve of the wind turbine.
174174
Indices are the wind speeds of the power curve in m/s, the
175-
corresponding power values are in the column 'P'.
175+
corresponding power values in W are in the column 'p'.
176176
177177
Returns
178178
-------
@@ -223,7 +223,7 @@ def p_curve_density_corr(v_wind, rho_hub, p_values):
223223
p_values.index * (1.225 / rho_hub[i])**(
224224
np.interp(p_values.index,
225225
[7.5, 12.5], [1/3, 2/3])),
226-
p_values.P, left=0, right=0))
226+
p_values.p, left=0, right=0))
227227
for i in range(len(v_wind))]
228228

229229
# Set index for time series

windpowerlib/wind_turbine.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ class WindTurbine(object):
3737
p_values : pandas.DataFrame
3838
Power curve of the wind turbine.
3939
The indices of the DataFrame are the corresponding wind speeds of the
40-
power curve, the power values are listed in the column 'P'.
40+
power curve, the power values are listed in the column 'p'.
4141
Default: None.
4242
nominal_power : float
4343
The nominal output of the wind turbine in W.
4444
fetch_curve : string
4545
Parameter to specify whether the power or power coefficient curve
46-
should be retrieved from the provided turbine data. Default: 'P'.
46+
should be retrieved from the provided turbine data. Default: 'p'.
4747
4848
Attributes
4949
----------
@@ -62,14 +62,14 @@ class WindTurbine(object):
6262
the column 'cp'. Default: None.
6363
p_values : pandas.DataFrame
6464
Power curve of the wind turbine.
65-
The indices of the DataFrame are the corresponding wind speeds of the
66-
power curve, the power values are listed in the column 'P'.
65+
Indices are the wind speeds of the power curve in m/s, the
66+
corresponding power values in W are in the column 'p'.
6767
Default: None.
6868
nominal_power : float
6969
The nominal output of the wind turbine in W.
7070
fetch_curve : string
7171
Parameter to specify whether the power or power coefficient curve
72-
should be retrieved from the provided turbine data. Default: 'P'.
72+
should be retrieved from the provided turbine data. Default: 'p'.
7373
power_output : pandas.Series
7474
The calculated power output of the wind turbine.
7575
@@ -87,7 +87,7 @@ class WindTurbine(object):
8787
"""
8888

8989
def __init__(self, turbine_name, hub_height, d_rotor, cp_values=None,
90-
p_values=None, nominal_power=None, fetch_curve='P'):
90+
p_values=None, nominal_power=None, fetch_curve='p'):
9191

9292
self.turbine_name = turbine_name
9393
self.hub_height = hub_height
@@ -165,8 +165,8 @@ def restructure_data():
165165
df.set_index('v_wind', drop=True, inplace=True)
166166
nominal_power = wpp_df['p_nom'].iloc[0]
167167
return df, nominal_power
168-
if self.fetch_curve == 'P':
169-
filename = 'P_curves.csv'
168+
if self.fetch_curve == 'p':
169+
filename = 'p_curves.csv'
170170
p_values, p_nom = restructure_data()
171171
self.p_values = p_values
172172
else:
@@ -189,7 +189,7 @@ def read_turbine_data(**kwargs):
189189
datapath : string, optional
190190
Path where the data file is stored. Default: './data'
191191
filename : string, optional
192-
Name of data file. Default: 'cp_curves.csv'
192+
Name of data file. Default: 'p_curves.csv'
193193
194194
Returns
195195
-------
@@ -202,7 +202,7 @@ def read_turbine_data(**kwargs):
202202
kwargs['datapath'] = os.path.join(os.path.dirname(__file__), 'data')
203203

204204
if 'filename' not in kwargs:
205-
kwargs['filename'] = 'cp_curves.csv'
205+
kwargs['filename'] = 'p_curves.csv'
206206

207207
df = pd.read_csv(os.path.join(kwargs['datapath'], kwargs['filename']),
208208
index_col=0)

0 commit comments

Comments
 (0)