Coverage for bim2sim/plugins/PluginEnergyPlus/bim2sim_energyplus/task/load_energyplus_results.py: 0%
15 statements
« prev ^ index » next coverage.py v7.6.12, created at 2025-03-12 17:09 +0000
« prev ^ index » next coverage.py v7.6.12, created at 2025-03-12 17:09 +0000
1import json
2import re
3from pathlib import Path
5from geomeppy import IDF
7import bim2sim
8from bim2sim.tasks.base import ITask
11class LoadEnergyPlusResults(ITask):
12 """Load existing results, run() method holds detailed information."""
13 touches = ('sim_results_path', 'idf')
15 def run(self):
16 """Loads existing EnergyPlus results from a previous simulation.
18 The idf file from a previous simulation is loaded and stored in the
19 playground state. The intended behaviour is that for the following
20 tasks with post-processing and plotting there should be no difference
21 if a total bim2sim plugin run is performed or the existing results are
22 loaded.
24 Returns:
25 sim_results_path: path where to store the plots
26 idf: loaded EnergyPlus input file
27 """
28 model_export_name = self.prj_name
29 sim_results_path = (self.paths.export / 'EnergyPlus' / 'SimResults')
30 # load bldg names via directory structure and store them
31 ep_install_path = self.playground.sim_settings.ep_install_path
32 # set the plugin path of the PluginEnergyPlus within the BIM2SIM Tool
33 # set Energy+.idd as base for new idf
34 IDF.setiddname(ep_install_path / 'Energy+.idd')
35 idf = IDF(sim_results_path.as_posix() + f"/{model_export_name}"
36 f"/{model_export_name}.idf")
37 return sim_results_path, idf