"""Abstract base classes for ARCADE pipeline stages."""
from __future__ import annotations
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Any
[docs]
class BaseDataStage(ABC):
"""Load, demodulate, preprocess, split, and detect transitions."""
[docs]
@abstractmethod
def run(
self,
cfg: Any,
*,
cache_dir: str | Path | None = None,
demod_cache_path: str | Path | None = None,
classifiers_run: list[str] | None = None,
) -> dict[str, Any]:
...
[docs]
class BaseFeatureStage(ABC):
"""Compute filter banks / feature sets from transition results."""
[docs]
@abstractmethod
def run(self, cfg: Any, data_out: dict[str, Any]) -> dict[str, Any]:
...
[docs]
class BaseClassifyStage(ABC):
"""Train and evaluate classifiers (classify stage)."""
[docs]
@abstractmethod
def run(self, cfg: Any, data_out: dict[str, Any]) -> dict[str, Any]:
...
[docs]
class BaseOptimizationStage(ABC):
"""Post-training model optimization."""
[docs]
@abstractmethod
def run(self, cfg: Any, classify_out: dict[str, Any]) -> dict[str, Any]:
...
[docs]
class BaseHardwareStage(ABC):
"""FPGA resource estimation and export."""
[docs]
@abstractmethod
def run(self, cfg: Any, classify_out: dict[str, Any]) -> dict[str, Any]:
...
[docs]
class BaseVisualizationStage(ABC):
"""Generate plots and summary reports."""
[docs]
@abstractmethod
def run(
self,
cfg: Any,
data_out: dict[str, Any],
classify_out: dict[str, Any],
hardware_out: dict[str, Any],
) -> Path | None:
...