wip on new executor class
MODIFY
pangeo_forge_recipes/executors.py
pangeo_forge_recipes/executors.py
-from rechunker.executors import DaskPipelineExecutor # noqa: F401
-from rechunker.executors import PrefectPipelineExecutor # noqa: F401
-from rechunker.executors import PythonPipelineExecutor # noqa: F401
+from abc import ABC, abstractmethod
+from dataclasses import dataclass
+from typing import Dict, Callable, Any, Iterable, List, Optional
+from enum import Enum, auto
+
+
+class StageAnnotation(Enum):
+ CONCURRENCY = auto()
+ RETRIES = auto()
+
+
+Config = Any
+
+
+@dataclass(frozen=True)
+class Stage:
+ function: Callable
+ name: str
+ mappable: Optional[Iterable] = None
+ config: Optional[Config] = None
+ annotations: Optional[Dict[StageAnnotation, Any]] = None
+
+
+Pipeline = List[Stage]
+
+
+def pipeline_to_function():
+ pass

wip on new executor class