Skip to content
Snippets Groups Projects
Commit 4427851c authored by Jeremy M Fee's avatar Jeremy M Fee Committed by Claycomb, Abram Earl
Browse files

Rename Algorithm.get_starttime() to Algorithm.get_next_starttime()

parent 07c93591
No related branches found
No related tags found
No related merge requests found
......@@ -160,7 +160,7 @@ class Controller(object):
algorithm.get_input_channels()
output_channels = options.outchannels or \
algorithm.get_output_channels()
starttime = algorithm.get_starttime() or options.starttime
starttime = algorithm.get_next_starttime() or options.starttime
endtime = options.endtime
# input
timeseries = input_timeseries or self._get_input_timeseries(
......@@ -215,7 +215,7 @@ class Controller(object):
if update_count >= options.update_limit:
return
algorithm = self._algorithm
if algorithm.get_starttime() is not None:
if algorithm.get_next_starttime() is not None:
raise AlgorithmException(
'Stateful algorithms cannot use run_as_update')
input_channels = options.inchannels or \
......
......@@ -111,11 +111,12 @@ class Algorithm(object):
return False
return True
def get_starttime(self):
def get_next_starttime(self):
"""Check whether algorithm has a stateful start time.
When an algorithm reports a start time, the Controller attempts to
only process data moving forward.
When an algorithm reports a next_starttime, the Controller attempts to
only process data moving forward. This is typically the time of the
last processed sample, plus the delta between samples.
Returns
-------
......
......@@ -86,7 +86,7 @@ class SqDistAlgorithm(Algorithm):
'reinitializing.', file=sys.stderr)
return (start - 3 * 30 * 24 * 60 * 60, end)
def get_starttime(self):
def get_next_starttime(self):
"""Return the next_starttime from the state, if it is set.
"""
return self.next_starttime
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment