Skip to content
Snippets Groups Projects
Commit cff739f0 authored by Jonathan Kriwet's avatar Jonathan Kriwet
Browse files

change for force_same handling

parent 3a837256
Branches
No related tags found
No related merge requests found
......@@ -186,11 +186,15 @@ class EnergyPlusCalibrator:
if self.force_same is not None:
for force_to, force_from in self.force_same.items():
check_param(force_to)
if isinstance(force_from, (list, tuple)):
if isinstance(force_from[0], (list, tuple)):
for f in force_from[0]:
check_param(f)
else:
check_param(force_from[0])
else:
check_param(force_from)
def _get_tuner_paras_dict(self) -> Dict[str, Tuple[float, Tuple[float, float]]]:
"""
......@@ -541,6 +545,7 @@ class EnergyPlusCalibrator:
else:
results_folder = calibration_results_folder / folder_name
print(f"Results will be saved in {results_folder}")
results_folder.mkdir(parents=True)
to_copy = ['calibrated_model.json',
'calibrated_model.idf',
......
......@@ -407,10 +407,14 @@ class EnergyPlusAPI(SimulationAPI):
return parameters
for force_to, force_from in self.force_same.items():
if isinstance(force_from[0], str):
if isinstance(force_from, str):
parameters[force_to] = parameters[force_from]
continue
if isinstance(force_from, tuple) and not isinstance(force_from[1], str):
parameters[force_to] = parameters[force_from[0]] + \
force_from[1]
continue
elif not isinstance(force_from[0], tuple):
raise ValueError('force_from must be a tuple or a string')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment