Skip to content
Snippets Groups Projects
Commit 6355305d authored by Erin (Josh) Rigler's avatar Erin (Josh) Rigler
Browse files

update interval no longer shrinks with recursion

Previously, the endtime-starttime interval being processed by the
`run_as_update` method would shrink by 1 (second) with each recursion.
This ultimately broke `run_as_update` when processing anything other
than 1-second data, but it wasn't obvious because we rarely had to
actually recurse. There is a little trickery now to ensure that user-
provided starttime and endtime are inclusive of the full first
(most recent) update interval, while subsequent, calculated, endtimes
are set equal to the prior starttime minus specified output_interval
(e.g., 'second', 'minute', etc.).
parent 01e1e4a7
No related branches found
No related tags found
1 merge request!186update interval no longer shrinks with recursion
...@@ -426,9 +426,11 @@ class Controller(object): ...@@ -426,9 +426,11 @@ class Controller(object):
# check for fillable gap at start # check for fillable gap at start
if output_gap[0] == starttime: if output_gap[0] == starttime:
# found fillable gap at start, recurse to previous interval # found fillable gap at start, recurse to previous interval
interval = endtime - starttime delta = TimeseriesUtility.get_delta_from_interval(output_interval)
recurse_starttime = starttime - interval recurse_starttime = (
recurse_endtime = starttime - 1 starttime - (endtime - starttime) - delta * bool(update_count)
)
recurse_endtime = starttime - delta
self.run_as_update( self.run_as_update(
algorithm=algorithm, algorithm=algorithm,
observatory=observatory, observatory=observatory,
......
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