From f02fb43160bcabe091541ffa999e29ae0a29584e Mon Sep 17 00:00:00 2001 From: guille Date: Thu, 9 Jun 2022 15:40:43 -0400 Subject: [PATCH] EP workflow now removes previous results. --- scripts/ep_workflow.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/ep_workflow.py b/scripts/ep_workflow.py index 5d13f0bc..244dd205 100644 --- a/scripts/ep_workflow.py +++ b/scripts/ep_workflow.py @@ -1,3 +1,5 @@ +import glob +import os import sys from pathlib import Path import csv @@ -21,6 +23,11 @@ try: value = argument[1] if option == '-g': gml = value + out_path = (Path(__file__).parent.parent / 'out_files') + files = glob.glob(f'{out_path}/*') + for file in files: + if file != '.gitignore': + os.remove(file) print('[simulation start]') city = GeometryFactory('citygml', gml).city @@ -45,7 +52,7 @@ try: area += ground.perimeter_polygon.area print('exporting:') - out_path = (Path(__file__).parent.parent / 'out_files') + ExportsFactory('obj', city, out_path).export() print(' geometry exported...') # todo: _idf exporter does not catch errors in exporting