deflex.merit_order_from_scenario¶
-
deflex.
merit_order_from_scenario
(scenario, with_downtime=True, with_co2_price=True)[source]¶ Create a merit order from a deflex scenario.
Parameters: - scenario (deflex.Scenario) – Path of the directory where the csv files of the scenario are located.
- with_downtime (bool) – Use down time factor to reduce the installed capacity.
- with_co2_price (bool) – Consider the CO2 price to calculate the merit order.
Returns: Return type: pandas.DataFrame
Examples
>>> import os >>> import deflex as dflx >>> my_path = dflx.fetch_test_files("de02_no-heat_csv") >>> my_sc = dflx.DeflexScenario() >>> mo1 = dflx.merit_order_from_scenario(my_sc.read_csv(my_path)) >>> round(mo1.capacity_cum.iloc[-1], 4) 86.7028 >>> round(mo1.capacity.sum(), 1) 86702.8 >>> round(mo1.loc[("DE01", "natural gas - 0.55"), "costs_total"], 2) 49.37 >>> mo2 = merit_order_from_scenario(my_sc.read_csv(my_path), ... with_downtime=False) >>> int(round(mo2.capacity.sum(), 0)) 101405 >>> mo3 = merit_order_from_scenario(my_sc.read_csv(my_path), ... with_co2_price=False) >>> round(mo3.loc[("DE01", "natural gas - 0.55"), "costs_total"], 2) 43.58