def get_correlations(user, paths, group_by, start, end, sort, window_size, thresholds, use_cache = True): finder = CorrelationFinder(user, paths, group_by = group_by, start = start, end = end, sort = sort, window_size = window_size, thresholds = thresholds, use_cache = use_cache) correlations = [correlation.json_filter() for correlation in finder.get_correlations()] return json.dumps(correlations)
def run(self): # Do we have the required datastreams to run this correlation? if set(self.required_aspects).issubset(self.available_datastreams): # Okay, now let's look for some correlations! finder = CorrelationFinder(self.user, self.paths, window_size = self.window_size, thresholds = self.thresholds, use_cache = self.use_cache) self.correlations = finder.get_correlations()
def run(self): # Do we have the required datastreams to run this correlation? if set(self.required_aspects).issubset(self.available_datastreams): # Okay, now let's look for some correlations! finder = CorrelationFinder(self.user, self.paths, window_size=self.window_size, thresholds=self.thresholds, use_cache=self.use_cache) self.correlations = finder.get_correlations()
def get_correlations(user, paths, group_by, start, end, sort, window_size, thresholds, use_cache=True): finder = CorrelationFinder(user, paths, group_by=group_by, start=start, end=end, sort=sort, window_size=window_size, thresholds=thresholds, use_cache=use_cache) correlations = [ correlation.json_filter() for correlation in finder.get_correlations() ] return json.dumps(correlations)