From a8544093d547e9e4226235e8b02ebfda69484e93 Mon Sep 17 00:00:00 2001 From: Samuel Letellier-Duchesne Date: Sat, 28 Jan 2023 20:25:37 -0500 Subject: [PATCH] Fixes an issue where passing a new attributes to IDF.simulate would fail to create a new cache (#436) * Fixes an issue where passing a new attributes to IDF.simulate would fail to create a new cache * reformat --- archetypal/idfclass/idf.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/archetypal/idfclass/idf.py b/archetypal/idfclass/idf.py index b59c9649..a7eecbd6 100644 --- a/archetypal/idfclass/idf.py +++ b/archetypal/idfclass/idf.py @@ -5,6 +5,7 @@ """ import io import itertools +import logging import logging as lg import math import os @@ -1377,14 +1378,20 @@ def simulate(self, force=False, **kwargs): outputs. """ - if ( - self.simulation_dir.exists() and not force - ): # don't simulate if results exists - return self # First, update keys with new values for key, value in kwargs.items(): if f"_{key}" in self.__dict__.keys(): setattr(self, key, value) + else: + log( + f"IDF.simulate got invalid keyword '{key}'. Ignored", + level=logging.WARNING, + ) + + if ( + self.simulation_dir.exists() and not force + ): # don't simulate if results exists + return self if self.as_version is not None: if self.as_version != EnergyPlusVersion(self.idd_version):