Пример #1
0
    def test_returns_windowed_data_lazily(self):
        from collections.abc import Generator

        result = lineflow.window(self.data, self.window_size, lazy=True)
        self.assertIsInstance(result, Generator)
        for x, y in zip(result, self.expected):
            self.assertTupleEqual(x, y)
Пример #2
0
 def test_returns_windowed_data_eagerly(self):
     result = lineflow.window(self.data, self.window_size)
     self.assertIsInstance(result, list)
     for x, y in zip(result, self.expected):
         self.assertTupleEqual(x, y)
Пример #3
0
 def __iter__(self) -> Iterator[Any]:
     yield from lf.window(self._dataset,
                          self._window_size,
                          self._shift,
                          lazy=True)