from pathlib import Path
import shutil
from run_simstadt_workflow import find_simstadt, check_paths, SCRIPT_DIR, prepare_workflow, run_workflow

SIMSTADT2_GLOB = 'Desktop/SimStadt2_0.*/'
REPO_PATH = Path.home() / 'git' / 'simstadt2' / 'TestRepository'
PROJECT_NAME = 'Gruenbuehl'
CITYGMLS = ['Gruenbuehl_LOD2_ALKIS_1010_2buildings.gml']

PROJECT_PATH = REPO_PATH / f'{PROJECT_NAME}.proj'
PARAMS = 'params.xml'

print(find_simstadt(SIMSTADT2_GLOB))

TEMPLATE_NAME = '99_HeatDemand'

TEMPLATE = SCRIPT_DIR / 'Template' / f'{TEMPLATE_NAME}.flow' # Heat demand, with custom BuildingPhysics

WORKFLOW_PATH = PROJECT_PATH / f'{TEMPLATE_NAME}.flow'

shutil.copytree(TEMPLATE, WORKFLOW_PATH, dirs_exist_ok=True)





output_files = run_workflow(find_simstadt(SIMSTADT2_GLOB), WORKFLOW_PATH, CITYGMLS)

print(next(file for file in output_files if 'HEATING.csv' in file.name))
