Skip to content

Components

Base classes and registration functions of the components a plugin implements. Recipes: Extending.

Methods

marathonts.bench.methods.register_method

register_method(name, pool=None, assembler=None, long=None, description='', overwrite=False, joiner=None)

marathonts.bench.methods.register_stitch_suite

register_stitch_suite(prefix: str, pool: str, overwrite: bool = False, extra_assemblers=(), extra_joiners=()) -> list[str]

Register the whole stitching suite (config.STITCH_SUITE: the zseries stitcher, the random path, the alternative stitchers of BASELINES.md A–B) on one pool generator: zseries, rand, … — plus custom assemblers () and every seam-processing variant of every stitcher (_; which of them run is Config.smooth_paths / joiners). Every method of the suite shares the pool, so they differ only in the choice, order and seams of the windows. Idempotent; a name already registered with another pool / assembler raises unless overwrite. Returns the method names.

marathonts.bench.methods.register_long_method

register_long_method(name: str, long: str | None = None) -> str

A long generator as a method (by default under its own name); idempotent.

Generators

marathonts.bench.generators.base.GenContext dataclass

K property

K: int

Windows the assembler returns: the series' K, or more for a method with seam processing.

marathonts.bench.generators.base.PoolGenerator

load_state

load_state(arrays: dict[str, ndarray], ctx: 'GenContext')

Restore a fitted generator from state() arrays; returns self.

marathonts.bench.generators.base.LongGenerator

fit

fit(ctx: GenContext) -> None

Optional training step (timed separately as fit).

load_state

load_state(arrays: dict[str, ndarray], ctx: 'GenContext')

Restore a fitted generator from state() arrays; returns self.

Assembly

marathonts.bench.assemblers.Assembler

marathonts.bench.joiners.Joiner

Tasks and models

marathonts.bench.tasks.Task dataclass

marathonts.bench.tasks.register_task

register_task(task: Task, overwrite: bool = False) -> Task

marathonts.bench.models.BaseModel

load_state

load_state(arrays: dict[str, ndarray]) -> 'BaseModel'

Inverse of state(): the model predicts as when it was saved.

Fidelity metrics

marathonts.bench.fidelity.register_fidelity_group

register_fidelity_group(name: str, spec: dict, overwrite: bool = False, primary_only: bool = False)

Decorator: register fn(ctx) -> dict under name; spec = {metric: orientation} (+1 / −1; a tuple whose first element is the orientation is accepted too). Unless primary_only, the @<part> copies of every metric are registered too.

marathonts.bench.fidelity.FidelityContext dataclass

Hypotheses

marathonts.hypotheses.catalog.register_hypothesis

register_hypothesis(hid: str, title: str = '', overwrite: bool = False)

Decorator: fn(tables, cfg) -> {"global": DataFrame, "per_dataset": DataFrame, "extra": dict}. tables holds the benchmark tables (timing, fidelity, utility, cross_seed, datasets, pools).