Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Commit

Permalink
Use filtering by start only in online executions
Browse files Browse the repository at this point in the history
  • Loading branch information
benHeid committed Mar 28, 2022
1 parent 0bf5e41 commit 150ec5d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pywatts/core/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,12 @@ def _transform(self, x, batch=None):
start_step.buffer[key] = xr.concat([start_step.buffer[key], x[key][x[key][dim] > last]], dim=dim)
start_step.finished = True
time_index = _get_time_indexes(x)
self.counter = list(x.values())[0].indexes[time_index[0]][0] # The start date of the input time series.
last_steps = list(filter(lambda x: x.last, self.id_to_step.values()))
if not batch:
return self._collect_results(last_steps)
return self._collect_batches(last_steps)
else:
self.counter = list(x.values())[0].indexes[time_index[0]][0] # The start date of the input time series.
return self._collect_batches(last_steps)

def _collect_batches(self, last_steps):
result = dict()
Expand Down

0 comments on commit 150ec5d

Please sign in to comment.