semsynth.backends.base

Backend interface definitions for SemSynth.

Functions

ensure_backend_contract(module)

Validate that a backend module exposes a compliant run_experiment.

Classes

Any(*args, **kwargs)

Special type indicating an unconstrained type.

Backend(*args, **kwargs)

Protocol describing the callable surface for backend implementations.

BackendModule(*args, **kwargs)

Protocol applied to backend modules.

ModuleType

Path(*args, **kwargs)

PurePath subclass that can make system calls.

Protocol()

Base class for protocol classes.

pd

class semsynth.backends.base.Backend(*args, **kwargs)

Bases: Protocol

Protocol describing the callable surface for backend implementations.

run_experiment(df: pd.DataFrame, *, provider: str | None, dataset_name: str | None, provider_id: int | None, outdir: str, label: str, model_info: Dict[str, Any] | None, rows: int | None, seed: int, test_size: float, semmap_export: Dict[str, Any] | None = None) Path

Execute the backend for a dataset and return the run directory.

class semsynth.backends.base.BackendModule(*args, **kwargs)

Bases: Protocol

Protocol applied to backend modules.

run_experiment(*, provider: str | None, dataset_name: str | None, provider_id: int | None, outdir: str, label: str, model_info: Dict[str, Any] | None, rows: int | None, seed: int, test_size: float, semmap_export: Dict[str, Any] | None = None) Path

Execute the backend for a dataset and return the run directory.

semsynth.backends.base.ensure_backend_contract(module: ModuleType) None

Validate that a backend module exposes a compliant run_experiment.