Skip to content

Commit

Permalink
Fix typo (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
shenxiangzhuang authored Nov 1, 2023
1 parent 8402746 commit 8647363
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions engine/models/metric/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@


class AlertManager:
def __init__(self, tolearance: int = 5, least_alert: int = 2) -> None:
self.tolearance = tolearance
def __init__(self, tolerance: int = 5, least_alert: int = 2) -> None:
self.tolerance = tolerance
self.least_alert = least_alert
self.alert_cnt = 0
self.non_alert_cnt = 0
Expand All @@ -43,7 +43,7 @@ def get_alert(self, timestamp: str, data: Union[float, int], score: float):

else:
self.non_alert_cnt += 1
if self.non_alert_cnt > self.tolearance:
if self.non_alert_cnt > self.tolerance:
# Notification to alert
# print('Alert End')
self.alert_cnt = 0
Expand Down
2 changes: 1 addition & 1 deletion engine/models/tests/test_alert_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

def test_alert():

manager = AlertManager(tolearance=5, least_alert=2)
manager = AlertManager(tolerance=5, least_alert=2)

for idx, i in enumerate([0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1]):
score = manager.get_alert(score=i, timestamp=str(idx), data=i)
Expand Down

0 comments on commit 8647363

Please sign in to comment.