base

Base classes and mixins for no-reset benchmark analyzers.

class pysatl_cpd.benchmark.online.noreset.tooling.analyzers.base.NoResetAnalyzerBase(entries_picker=None)[source]

Bases: ABC

Base class for no-reset benchmark analyzers.

Provides a default entries_picker and lazily resolved registry property shared by all concrete analyzers.

Parameters:

entries_picker (BenchmarkEntriesPicker | None) – Strategy for selecting registry entries. Defaults to OnlineNoResetEntryAlgorithmPicker when not provided.

__init__(entries_picker=None)[source]
Parameters:

entries_picker (BenchmarkEntriesPicker | None)

Return type:

None

property registry: BenchmarkRegistry[Any, OnlineDetectionTrace[Any]]

Registry of cached detection runs.

Raises:

ValueError – If the registry has not been set yet.

pick_runs(benchmark_entry, *, entries_picker=None)[source]

Retrieve runs matching a benchmark entry from the registry.

Uses the supplied or default entries picker to select relevant keys, then fetches the corresponding SingleRun objects.

Parameters:
Returns:

Runs whose keys were selected by the picker.

Return type:

list[SingleRun[OnlineDetectionTrace[Any], Any]]

class pysatl_cpd.benchmark.online.noreset.tooling.analyzers.base.NoResetBisigementClassificationMixin[source]

Bases: ABC

Mixin that provides classification-report access and bisegment validation.

property classification_report: NoResetClassificationReport[Any, Any]

Classification report containing TP/FP/FN metric definitions.

Raises:

ValueError – If the report has not been set yet.

static validate_bisegment_runs(runs, expected_detector)[source]

Verify that every run matches the expected detector and is a valid bisegment.

Checks three conditions: all runs belong to the expected detector, all providers are of BISEGMENT type, and each provider has exactly one change point.

Parameters:
Raises:

ValueError – If any run fails the validation checks.

Return type:

None