Skip to content

Scenarios

matchbox.common.factories.scenarios

Scenario factories for creating TestkitDAG scenarios.

Functions:

Attributes:

ScenarioBuilder module-attribute

ScenarioBuilder = Callable[..., TestkitDAG]

SCENARIO_REGISTRY module-attribute

SCENARIO_REGISTRY: dict[str, ScenarioBuilder] = {}

register_scenario

register_scenario(name: str) -> Callable[[ScenarioBuilder], ScenarioBuilder]

Decorator to register a new scenario builder function.

create_bare_scenario

create_bare_scenario(backend: MatchboxDBAdapter, warehouse_engine: Engine, n_entities: int = 10, seed: int = 42, **kwargs: Any) -> TestkitDAG

Create a bare TestkitDAG scenario.

create_index_scenario

create_index_scenario(backend: MatchboxDBAdapter, warehouse_engine: Engine, n_entities: int = 10, seed: int = 42, **kwargs: Any) -> TestkitDAG

Create an index TestkitDAG scenario.

create_dedupe_scenario

create_dedupe_scenario(backend: MatchboxDBAdapter, warehouse_engine: Engine, n_entities: int = 10, seed: int = 42, **kwargs: Any) -> TestkitDAG

Create a dedupe TestkitDAG scenario.

create_probabilistic_dedupe_scenario

create_probabilistic_dedupe_scenario(backend: MatchboxDBAdapter, warehouse_engine: Engine, n_entities: int = 10, seed: int = 42, **kwargs: Any) -> TestkitDAG

Create a probabilistic dedupe TestkitDAG scenario.

create_link_scenario(backend: MatchboxDBAdapter, warehouse_engine: Engine, n_entities: int = 10, seed: int = 42, **kwargs: Any) -> TestkitDAG

Create a link TestkitDAG scenario.

create_alt_dedupe_scenario

create_alt_dedupe_scenario(backend: MatchboxDBAdapter, warehouse_engine: Engine, n_entities: int = 10, seed: int = 42, **kwargs: Any) -> TestkitDAG

Create a TestkitDAG scenario with two alternative dedupers.

create_convergent_scenario

create_convergent_scenario(backend: MatchboxDBAdapter, warehouse_engine: Engine, n_entities: int = 10, seed: int = 42, **kwargs: Any) -> TestkitDAG

Create a convergent TestkitDAG scenario.

This is where two SourceConfigs index almost identically. TestkitDAG contains two indexed sources with repetition, and two naive dedupe models that haven’t yet had their results inserted.

setup_scenario

setup_scenario(backend: MatchboxDBAdapter, scenario_type: Literal['bare', 'index', 'dedupe', 'link', 'probabilistic_dedupe', 'alt_dedupe', 'convergent'], warehouse: Engine, n_entities: int = 10, seed: int = 42, **kwargs: dict[str, Any]) -> Generator[TestkitDAG, None, None]

Context manager for creating TestkitDAG scenarios.