File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -296,11 +296,17 @@ def get_turbine_data_from_oedb(turbine_type, fetch_curve):
296296 else fetch_curve )
297297 # Select curve and nominal power of turbine type
298298 try :
299- df = pd . DataFrame ( turbine_data .loc [turbine_type ][ curve ])
299+ df = turbine_data .loc [turbine_type ]
300300 except KeyError :
301301 raise KeyError ("Turbine type '{}' not in database. " .format (
302302 turbine_type ) + "Use 'get_turbine_types()' to see a table of " +
303303 "possible wind turbine types." )
304+ if df [curve ] is not None :
305+ df = pd .DataFrame (df [curve ])
306+ else :
307+ sys .exit ("{} of {} not available in " .format (curve , turbine_type ) +
308+ "oedb. Use 'get_turbine_types()' to see for which turbine " +
309+ "types power coefficient curves are available." )
304310 nominal_power = turbine_data .loc [turbine_type ][
305311 'installed_capacity_kw' ] * 1000
306312 df .columns = ['wind_speed' , 'value' ]
You can’t perform that action at this time.
0 commit comments