summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2025-03-21 22:33:33 +0100
committerYuval Adam <_@yuv.al>2025-03-21 22:33:33 +0100
commit24e91b9e1b363a75a98afe48c3ec94b5874226e0 (patch)
tree8442996f4da6eba096f1cf1269e066a33ba0c2a2
parentba6b6dc1d31aac87cd3469804e5f72ae524ee248 (diff)
Cleanup formatting
-rw-r--r--rivulet/pipeline.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/rivulet/pipeline.py b/rivulet/pipeline.py
index 226a645..6efd821 100644
--- a/rivulet/pipeline.py
+++ b/rivulet/pipeline.py
@@ -1,8 +1,9 @@
-from typing import AsyncGenerator, TypeVar, Callable, List, Generic, Any
+from typing import AsyncGenerator, TypeVar, Callable, List, Any
+
+T = TypeVar("T")
+U = TypeVar("U")
+V = TypeVar("V")
-T = TypeVar('T')
-U = TypeVar('U')
-V = TypeVar('V')
class Pipeline:
"""
@@ -14,9 +15,14 @@ class Pipeline:
def __init__(self, source: AsyncGenerator[Any, None]):
"""Initialize the pipeline with a source async generator."""
self.source = source
- self.steps: List[Callable[[AsyncGenerator[Any, None]], AsyncGenerator[Any, None]]] = []
+ self.steps: List[
+ Callable[[AsyncGenerator[Any, None]], AsyncGenerator[Any, None]]
+ ] = []
- def add_step(self, transform: Callable[[AsyncGenerator[Any, None]], AsyncGenerator[Any, None]]):
+ def add_step(
+ self,
+ transform: Callable[[AsyncGenerator[Any, None]], AsyncGenerator[Any, None]],
+ ):
"""
Add a transformation step to the pipeline.
@@ -60,4 +66,4 @@ class Pipeline:
results = []
async for item in self:
results.append(item)
- return results \ No newline at end of file
+ return results