Exemplo n.º 1
0
    def iter_datasets(self) -> Iterator[Dataset[T]]:
        """Iterate over the output datasets of this pipeline.

        Returns:
            Iterator over the datasets outputted from this pipeline.
        """
        return PipelineExecutor(self)
Exemplo n.º 2
0
    def iter_datasets(self) -> Iterator[Dataset[T]]:
        """Iterate over the output datasets of this pipeline.

        Returns:
            Iterator over the datasets outputted from this pipeline.
        """
        if self._executed[0]:
            raise RuntimeError("Pipeline cannot be read multiple times.")
        self._executed[0] = True
        return PipelineExecutor(self)
Exemplo n.º 3
0
 def _peek(self) -> Dataset[T]:
     if self._first_dataset is None:
         self._optimize_stages()
         self._dataset_iter = PipelineExecutor(self)
         self._first_dataset = next(self._dataset_iter)
     return self._first_dataset