Skip to content

Commit

Permalink
Issue Pyrrha-Platform#29 - Add batch capability for running analytics…
Browse files Browse the repository at this point in the history
… over historical results (e.g. after uploading data from SD cards)
  • Loading branch information
JSegrave-IBM committed Mar 23, 2021
1 parent 7bb26f5 commit 158a3f0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/GasExposureAnalytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,10 @@ def batch_run_analytics_by_date (self, date, commit=True) :
index = self._sensor_log_from_csv_df.sort_index().loc[date:date].index
start_time = index.min()
end_time = index.max()

# If there's no data for the requested day, return None
if (start_time is None) or (end_time is None) :
return None

# Adjust the end - should allow for the longest time-weighted averaging window to be fully-reported.
longest_window_in_mins = max([window['mins'] for window in self.WINDOWS_AND_LIMITS])
Expand Down

0 comments on commit 158a3f0

Please sign in to comment.