From 703da5a96207eab79025622057b89fd2ff1dc9cf Mon Sep 17 00:00:00 2001 From: Zolan Date: Wed, 4 Sep 2024 15:56:25 -0600 Subject: [PATCH] fix clean functions --- reoptjl/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reoptjl/models.py b/reoptjl/models.py index 054e28461..f4888600d 100644 --- a/reoptjl/models.py +++ b/reoptjl/models.py @@ -5464,10 +5464,10 @@ class ASHPSpaceHeaterInputs(BaseModel, models.Model): default = -10.0, help_text=("Temperature threshold below which resistive back-up heater turns on [Fahrenheit]") ) - + def clean(self): error_messages = {} - if self.dict.get("min_allowable_ton") > 0 and self.dict.get("min_allowable_peak_capacity_fraction") > 0: + if self.dict.get("min_allowable_ton") not in [None, "", []] and self.dict.get("min_allowable_peak_capacity_fraction") not in [None, "", []]: error_messages["bad inputs"] = "At most one of min_allowable_ton and min_allowable_peak_capacity_fraction may be input to model {}".format(self.key) if error_messages: @@ -5736,7 +5736,7 @@ class ASHPWaterHeaterInputs(BaseModel, models.Model): def clean(self): error_messages = {} - if self.dict.get("min_allowable_ton") > 0 and self.dict.get("min_allowable_peak_capacity_fraction") > 0: + if self.dict.get("min_allowable_ton") not in [None, "", []] and self.dict.get("min_allowable_peak_capacity_fraction") not in [None, "", []]: error_messages["bad inputs"] = "At most one of min_allowable_ton and min_allowable_peak_capacity_fraction may be input to model {}".format(self.key) if error_messages: