Bug fix in PiecewiseconstantFunction (models.py)
This commit is contained in:
parent
e49579d3fe
commit
ec2a54c0a6
1 changed files with 1 additions and 1 deletions
|
|
@ -111,7 +111,7 @@ class PiecewiseconstantFunction:
|
|||
def __post_init__(self):
|
||||
if len(self.transition_times) != len(self.values)+1:
|
||||
raise ValueError("transition_times should contain one more element than values")
|
||||
if list(set(self.transition_times)) != self.transition_times:
|
||||
if sorted(list(set(self.transition_times))) != self.transition_times:
|
||||
raise ValueError("transition_times should not contain duplicated elements and should be sorted")
|
||||
|
||||
def value(self,time) -> float:
|
||||
|
|
|
|||
Loading…
Reference in a new issue