Skip to content

Commit

Permalink
set self.min_allowable_peak_capacity_fraction = 0.5 if no min allowab…
Browse files Browse the repository at this point in the history
…le inputs for ASHP systems
  • Loading branch information
zolanaj committed Sep 5, 2024
1 parent 6d1788d commit 70697a7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions reoptjl/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5465,6 +5465,9 @@ class ASHPSpaceHeaterInputs(BaseModel, models.Model):

def clean(self):
error_messages = {}
if self.dict.get("min_allowable_ton") in [None, "", []] and self.dict.get("min_allowable_peak_capacity_fraction") in [None, "", []]:
self.min_allowable_peak_capacity_fraction = 0.5

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)

Expand Down Expand Up @@ -5732,6 +5735,9 @@ class ASHPWaterHeaterInputs(BaseModel, models.Model):

def clean(self):
error_messages = {}
if self.dict.get("min_allowable_ton") in [None, "", []] and self.dict.get("min_allowable_peak_capacity_fraction") in [None, "", []]:
self.min_allowable_peak_capacity_fraction = 0.5

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)

Expand Down

0 comments on commit 70697a7

Please sign in to comment.