@@ -363,17 +363,18 @@ def load_turbine_data_from_oedb():
363363 'oedb_{}.csv' )
364364 # get all power (coefficient) curves and save to file
365365 # for curve_type in ['power_curve', 'power_coefficient_curve']:
366- for curve_type in ['power ' , 'cp ' ]: #todo change after renaming
366+ for curve_type in ['power_curve ' , 'power_coefficient_curve ' ]:
367367 curves_df = pd .DataFrame (columns = ['wind_speed' ])
368368 for index in turbine_data .index :
369- if (turbine_data ['wind_speed_{}_value ' .format (curve_type )][index ] and
370- turbine_data ['{}_value ' .format (curve_type )][index ]):
369+ if (turbine_data ['{}_wind_speeds ' .format (curve_type )][index ]
370+ and turbine_data ['{}_values ' .format (curve_type )][index ]):
371371 df = pd .DataFrame (data = [
372- eval (turbine_data ['wind_speed_{}_value' .format (curve_type )][index ]),
373- eval (turbine_data ['{}_value' .format (curve_type )][
372+ eval (turbine_data ['{}_wind_speeds' .format (curve_type )][
373+ index ]),
374+ eval (turbine_data ['{}_values' .format (curve_type )][
374375 index ])]).transpose ().rename (
375- columns = {0 : 'wind_speed' ,
376- 1 : turbine_data ['turbine_type' ][index ]})
376+ columns = {0 : 'wind_speed' ,
377+ 1 : turbine_data ['turbine_type' ][index ]})
377378 if turbine_data ['turbine_type' ][index ] not in [
378379 'S104/3400' , 'S126/6150' , 'V164/8000' , 'MM92/2050' ]: # todo delete after fixed in OEP
379380 curves_df = pd .merge (left = curves_df , right = df , how = 'outer' ,
@@ -385,7 +386,7 @@ def load_turbine_data_from_oedb():
385386 right = turbine_data [['turbine_type' ,
386387 'installed_capacity' ]],
387388 on = 'turbine_type' ).set_index ('turbine_type' )
388- curves_df .to_csv (filename .format ('{}_curves ' .format (curve_type )))
389+ curves_df .to_csv (filename .format ('{}s ' .format (curve_type )))
389390
390391 return turbine_data
391392
0 commit comments