From 0f908457d76452d4c2c740117b861520f48cf096 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Thu, 19 Oct 2023 10:42:23 +0200 Subject: [PATCH] Fix checking if results should be exported vis csv_export --- etrago/tools/execute.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/etrago/tools/execute.py b/etrago/tools/execute.py index ea643bf2..b99b798c 100755 --- a/etrago/tools/execute.py +++ b/etrago/tools/execute.py @@ -259,14 +259,14 @@ def iterate_lopf( args["temporal_disaggregation"]["active"] is True and etrago.conduct_dispatch_disaggregation is False ): - if not args["csv_export"] is False: + if args["csv_export"]: path = path + "/temporally_reduced" - if not args["lpfile"] is False: + if args["lpfile"]: lp_path = lp_path[0:-3] + "_temporally_reduced.lp" if etrago.conduct_dispatch_disaggregation is not False: - if not args["lpfile"] is False: + if args["lpfile"]: lp_path = lp_path[0:-3] + "_dispatch_disaggregation.lp" etrago.network_tsa.lines["s_nom"] = etrago.network.lines["s_nom_opt"] @@ -315,7 +315,7 @@ def iterate_lopf( for i in range(1, (1 + n_iter)): run_lopf(etrago, extra_functionality, method) - if not args["csv_export"]: + if args["csv_export"]: path_it = path + "/lopf_iteration_" + str(i) etrago.export_to_csv(path_it) @@ -349,7 +349,7 @@ def iterate_lopf( i += 1 - if not args["csv_export"]: + if args["csv_export"]: path_it = path + "/lopf_iteration_" + str(i) etrago.export_to_csv(path_it) @@ -360,7 +360,7 @@ def iterate_lopf( else: run_lopf(etrago, extra_functionality, method) - if not args["lpfile"] is False: + if args["lpfile"]: network.model.write(lp_path) return network @@ -881,7 +881,7 @@ def drop_foreign_components(network): foreign_series[comp][attr], comp, attr ) - if not args["csv_export"]: + if args["csv_export"]: path = args["csv_export"] + "/pf_post_lopf" etrago.export_to_csv(path) pf_solve.to_csv(os.path.join(path, "pf_solution.csv"), index=True)