@@ -282,8 +282,10 @@ def load_turbine_data_from_oedb():
282282 # orderby = 'order_by=version'
283283
284284 # load data
285+ # result = rq.get(oep_url + '/api/v0/schema/' + schema +
286+ # '/tables/' + table + '/rows/?', )
285287 result = rq .get (oep_url + '/api/v0/schema/' + schema +
286- '/tables/' + table + '/rows/?' , )
288+ '/tables/' + table + '/rows/?' , verify = False , ) # todo: after SSL certificate renewed: verify = True
287289 if result .status_code == 200 :
288290 logging .info ("Data base connection successful." )
289291 else :
@@ -321,11 +323,14 @@ def get_turbine_types(print_out=True):
321323 p_nom 3000000
322324 Name: 25, dtype: object
323325
324- """ # todo add cp-curves
326+ """
325327 df = load_turbine_data_from_oedb ()
326- curves_df = df .iloc [df .loc [df ['has_power_curve' ] == True ].index ][
327- ['manufacturer' , 'turbine_type' ]]
328-
328+ cp_curves_df = df .iloc [df .loc [df ['has_cp_curve' ] == True ].index ][
329+ ['manufacturer' , 'turbine_type' , 'has_cp_curve' ]]
330+ p_curves_df = df .iloc [df .loc [df ['has_power_curve' ] == True ].index ][
331+ ['manufacturer' , 'turbine_type' , 'has_power_curve' ]]
332+ curves_df = pd .merge (p_curves_df , cp_curves_df , how = 'outer' ,
333+ sort = True ).fillna (False )
329334 if print_out :
330335 pd .set_option ('display.max_rows' , len (curves_df ))
331336 print (curves_df )
0 commit comments