a60a18a253
Introduce ruff lint/format config, expand .gitignore, and reformat Python sources. Co-authored-by: Cursor <cursoragent@cursor.com>
48 lines
985 B
Python
48 lines
985 B
Python
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass, field
|
|
from pathlib import Path
|
|
from typing import TYPE_CHECKING, Any
|
|
|
|
if TYPE_CHECKING:
|
|
from imagepipeline.modules.base import BaseModule
|
|
|
|
|
|
INPUT_SOURCE = "input"
|
|
|
|
|
|
@dataclass
|
|
class StepDefinition:
|
|
"""Internal step registered on a pipeline."""
|
|
|
|
step_id: str
|
|
module_name: str
|
|
module: BaseModule
|
|
input_refs: list[str]
|
|
params: dict[str, Any]
|
|
output_dir_name: str
|
|
|
|
|
|
@dataclass
|
|
class StepRef:
|
|
"""Reference to a pipeline step, returned by Pipeline.step()."""
|
|
|
|
step_id: str
|
|
output_dir_name: str
|
|
|
|
def __repr__(self) -> str:
|
|
return f"StepRef({self.output_dir_name!r})"
|
|
|
|
|
|
@dataclass
|
|
class StepResult:
|
|
"""Result of an executed step."""
|
|
|
|
step_id: str
|
|
output_dir_name: str
|
|
module_name: str
|
|
output_dir: Path
|
|
input_paths: list[Path]
|
|
output_paths: list[Path] = field(default_factory=list)
|
|
params: dict[str, Any] = field(default_factory=dict)
|