From 73772b14fc61a79ef264b3a65cc888da8c0ef052 Mon Sep 17 00:00:00 2001 From: ulfmueller Date: Fri, 3 Nov 2023 11:19:23 +0100 Subject: [PATCH] find a smarter place for market result csv export --- etrago/execute/market_optimization.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/etrago/execute/market_optimization.py b/etrago/execute/market_optimization.py index 49d6c2ff..23077c96 100644 --- a/etrago/execute/market_optimization.py +++ b/etrago/execute/market_optimization.py @@ -66,6 +66,12 @@ def market_optimization(self): extra_functionality=extra_functionality(), formulation=self.args["model_formulation"], ) + + # quick and dirty csv export of market model results + path = self.args["csv_export"] + if not os.path.exists(path): + os.makedirs(path, exist_ok=True) + self.market_model.export_to_csv_folder(path + "/market") #self.market_model.model.write('/home/ulf/file2.lp') def build_market_model(self): @@ -137,13 +143,6 @@ def build_market_model(self): self.market_model = net - - # quick and dirty csv export of market model results - path = self.args["csv_export"] - if not os.path.exists(path): - os.makedirs(path, exist_ok=True) - self.market_model.export_to_csv_folder(path + "/market") - # Todo: buses_by_country() geolocation_buses() apply on market_model does not work because no self.network?!