@@ -237,18 +237,37 @@ def power_curve_density_correction(
237237
238238 """
239239 if density is None :
240- raise TypeError ("`density` is None. For the calculation with a " +
241- "density corrected power curve density at hub " +
242- "height is needed." )
243- power_output = [(np .interp (
244- wind_speed [i ], power_curve_wind_speeds * (1.225 / density [i ]) ** (
245- np .interp (power_curve_wind_speeds , [7.5 , 12.5 ], [1 / 3 , 2 / 3 ])),
246- power_curve_values , left = 0 , right = 0 )) for i in range (len (wind_speed ))]
240+ raise TypeError (
241+ "`density` is None. For the calculation with a "
242+ + "density corrected power curve density at hub "
243+ + "height is needed."
244+ )
245+ power_output = [
246+ (
247+ np .interp (
248+ wind_speed [i ],
249+ power_curve_wind_speeds
250+ * (1.225 / density [i ])
251+ ** (
252+ np .interp (
253+ power_curve_wind_speeds , [7.5 , 12.5 ], [1 / 3 , 2 / 3 ]
254+ )
255+ ),
256+ power_curve_values ,
257+ left = 0 ,
258+ right = 0 ,
259+ )
260+ )
261+ for i in range (len (wind_speed ))
262+ ]
247263
248264 # Power_output as pd.Series if wind_speed is pd.Series (else: np.array)
249265 if isinstance (wind_speed , pd .Series ):
250- power_output = pd .Series (data = power_output , index = wind_speed .index ,
251- name = 'feedin_power_plant' )
266+ power_output = pd .Series (
267+ data = power_output ,
268+ index = wind_speed .index ,
269+ name = "feedin_power_plant" ,
270+ )
252271 else :
253- power_output = np .array (power_output )
272+ power_output = np .array (power_output )
254273 return power_output
0 commit comments