Skip to content

Commit

Permalink
Refactor code in Updater.py to use new method for loading all alarms
Browse files Browse the repository at this point in the history
  • Loading branch information
petya-vasileva committed Dec 20, 2023
1 parent b20c55e commit 980546c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/model/Updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def __init__(self):
print(traceback.format_exc())



# The following function is used to group alarms by site
# taking into account the most recent 24 hours only
def groupAlarms(self, pivotFrames):
Expand Down Expand Up @@ -172,7 +173,7 @@ def storeMetaData(self):
def storeAlarms(self):
dateFrom, dateTo = hp.defaultTimeRange(60)
print("Update data. Get all alarms for the past 60 days...", dateFrom, dateTo)
frames, pivotFrames = self.alarms.loadData(dateFrom, dateTo)
frames, pivotFrames = self.alarms.getAllAlarms(dateFrom, dateTo)
self.groupAlarms(pivotFrames)

for event,df in pivotFrames.items():
Expand Down

0 comments on commit 980546c

Please sign in to comment.