Skip to content

Commit

Permalink
Fix checking if results should be exported vis csv_export
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaraBuettner committed Oct 19, 2023
1 parent a851557 commit 0f90845
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions etrago/tools/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0f90845

Please sign in to comment.