Skip to content

Commit

Permalink
Change parameter from path to scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
uvchik committed Mar 2, 2021
1 parent 3577fcd commit c502bf2
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/deflex/analyses.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def merit_order_from_results(result):
return values


def check_comparision_of_merit_order(path):
def check_comparision_of_merit_order(scenario):
"""Comparison of two different ways to calculate the merit order.
1. Calculate the merit order from scenario
Expand All @@ -243,16 +243,12 @@ def check_comparision_of_merit_order(path):
>>> from deflex import tools
>>> name = "de02.dflx"
>>> my_path = tools.fetch_example_results(name)
>>> check_comparision_of_merit_order(my_path)
>>> sc = scenario.restore_scenario(my_path)
>>> check_comparision_of_merit_order(sc)
Check passed! Both merit order DataFrame tables are the same.
"""

tmp_path = os.path.join(os.path.expanduser("~"), ".deflex", "tmp_dx34_f")

# Fetch Results and store
deflex_scenario = scenario.restore_scenario(path, scenario.DeflexScenario)
mo_scenario = merit_order_from_scenario(deflex_scenario)
mo_results = merit_order_from_results(deflex_scenario.results)
mo_scenario = merit_order_from_scenario(scenario)
mo_results = merit_order_from_results(scenario.results)

mo_results.index = mo_scenario.index

Expand All @@ -270,8 +266,6 @@ def check_comparision_of_merit_order(path):
)
print("Check passed! Both merit order DataFrame tables are the same.")

rmtree(tmp_path)


def get_flow_results(result):
"""
Expand Down

0 comments on commit c502bf2

Please sign in to comment.