Skip to content

Commit

Permalink
More lenient typelimit parsing (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Letellier-Duchesne committed May 20, 2021
1 parent c6bad04 commit 8bbc454
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions archetypal/schedule.py
Expand Up @@ -1160,11 +1160,15 @@ def Type(self, value):
value = ScheduleTypeLimits("Fraction", 0, 1)
elif value.lower() == "temperature":
value = ScheduleTypeLimits("Temperature", -100, 100)
elif value.lower() == "on/off":
value = ScheduleTypeLimits("On/Off", 0, 1, "Discrete", "availability")
else:
raise ValueError(
value = ScheduleTypeLimits("Fraction", 0, 1)
log(
f"'{value}' is not a known ScheduleTypeLimits for "
f"{self.Name}. Please instantiate the object before "
f"passing as the 'Type' parameter."
f"passing as the 'Type' parameter.",
level=lg.WARNING,
)
assert isinstance(value, ScheduleTypeLimits), value
self._schedule_type_limits = value
Expand Down

0 comments on commit 8bbc454

Please sign in to comment.