@@ -31,18 +31,18 @@ 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 'power coefficient ' columns/keys with wind
35- speeds in m/s and the corresponding power coefficients. Default: None.
34+ have 'wind_speed' and 'values ' columns/keys with wind speeds in m/s
35+ 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
38- 'wind_speed' and 'power ' columns/keys with wind speeds in m/s and the
38+ 'wind_speed' and 'values ' columns/keys with wind speeds in m/s and the
3939 corresponding power curve value in W. Default: None.
4040 nominal_power : None or float
4141 The nominal output of the wind turbine in W.
4242 fetch_curve : string
43- Parameter to specify whether the power or power coefficient curve
43+ Parameter to specify whether a power or power coefficient curve
4444 should be retrieved from the provided turbine data. Valid options are
45- 'power_curve' and 'power_coefficient_curve'. Default: 'power_curve' .
45+ 'power_curve' and 'power_coefficient_curve'. Default: None .
4646
4747 Attributes
4848 ----------
@@ -56,37 +56,45 @@ 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 'power coefficient ' columns/keys with wind speeds
60- in m/s and the corresponding power coefficients. Default: None.
59+ have 'wind_speed' and 'values ' columns/keys with wind speeds in m/s
60+ 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 'power ' columns/keys with wind speeds in m/s and the
63+ 'wind_speed' and 'values ' 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.
6767 fetch_curve : string
68- Parameter to specify whether the power or power coefficient curve
68+ Parameter to specify whether a power or power coefficient curve
6969 should be retrieved from the provided turbine data. Valid options are
70- 'power_curve' and 'power_coefficient_curve'. Default: 'power_curve' .
70+ 'power_curve' and 'power_coefficient_curve'. Default: None .
7171 power_output : pandas.Series
7272 The calculated power output of the wind turbine.
7373
74+ Notes
75+ ------
76+ Your wind turbine object should have a power coefficient or power curve.
77+ You can set the `fetch_curve` parameter if you don't want to provide one
78+ yourself but want to automatically fetch a curve from the data set
79+ provided along with the windpowerlib.
80+
7481 Examples
7582 --------
7683 >>> from windpowerlib import wind_turbine
7784 >>> enerconE126 = {
7885 ... 'hub_height': 135,
7986 ... 'rotor_diameter': 127,
80- ... 'object_name': 'ENERCON E 126 7500'}
87+ ... 'object_name': 'ENERCON E 126 7500',
88+ ... 'fetch_curve': 'power_curve'}
8189 >>> e126 = wind_turbine.WindTurbine(**enerconE126)
8290 >>> print(e126.nominal_power)
8391 7500000
8492
8593 """
8694
87- def __init__ (self , object_name , hub_height , rotor_diameter = None ,
95+ def __init__ (self , turbine_name , hub_height , rotor_diameter = None ,
8896 power_coefficient_curve = None , power_curve = None ,
89- nominal_power = None , fetch_curve = 'power_curve' ):
97+ nominal_power = None , fetch_curve = None ):
9098
9199 self .object_name = object_name
92100 self .hub_height = hub_height
@@ -101,6 +109,7 @@ def __init__(self, object_name, hub_height, rotor_diameter=None,
101109 if self .power_coefficient_curve is None and self .power_curve is None :
102110 self .fetch_turbine_data ()
103111
112+ # ToDo: Have fetch_curve as an input to this function.
104113 def fetch_turbine_data (self ):
105114 r"""
106115 Fetches data of the requested wind turbine.
@@ -126,7 +135,7 @@ def fetch_turbine_data(self):
126135 ... 'object_name': 'ENERCON E 126 7500',
127136 ... 'fetch_curve': 'power_coefficient_curve'}
128137 >>> e126 = wind_turbine.WindTurbine(**enerconE126)
129- >>> print(e126.power_coefficient_curve['power coefficient '][5])
138+ >>> print(e126.power_coefficient_curve['values '][5])
130139 0.423
131140 >>> print(e126.nominal_power)
132141 7500000
@@ -170,11 +179,7 @@ def restructure_data():
170179 data = np .vstack ((data , np .array (
171180 [float (col ), float (wpp_df [col ])])))
172181 data = np .delete (data , 0 , 0 )
173- if self .fetch_curve == 'power_curve' :
174- df = pd .DataFrame (data , columns = ['wind_speed' , 'power' ])
175- if self .fetch_curve == 'power_coefficient_curve' :
176- df = pd .DataFrame (data , columns = ['wind_speed' ,
177- 'power coefficient' ])
182+ df = pd .DataFrame (data , columns = ['wind_speed' , 'values' ])
178183 nominal_power = wpp_df ['p_nom' ].iloc [0 ]
179184 return df , nominal_power
180185 if self .fetch_curve == 'power_curve' :
0 commit comments