Skip to content

Configuration and specifications

Execution configuration

ExecutionConfig is immutable and validates backend, device, dtype, memory, temporary-storage, and repeated-projection settings when it is created.

ExecutionConfig dataclass

ExecutionConfig(backend='auto', device='auto', dtype=None, memory_budget=None, embedding_workers=1, pair_order_strategy='auto', temporary_directory=None, temporary_budget=None)

Select the exact execution capabilities available to ZADU.

memory_budget_bytes property

memory_budget_bytes

Normalized memory budget in bytes.

temporary_budget_bytes property

temporary_budget_bytes

Maximum package-managed temporary disk usage in bytes.

resolved_backend property

resolved_backend

resolved_device property

resolved_device

resolved_dtype property

resolved_dtype

Measure identifiers

MEASURE provides autocomplete-friendly names for every registered measure. Each enum value is the full module ID; the scheduler also accepts the short aliases listed in the measure reference.

MEASURE

Specification helper

make_spec

make_spec(id, **params)

Build one ZADU specification item with typed autocomplete-friendly arguments.

Source code in src/zadu/spec.py
def make_spec(id: str | MEASURE, **params: Any) -> Spec:
    """Build one ZADU specification item with typed autocomplete-friendly arguments."""

    return {
        "id": id.value if isinstance(id, MEASURE) else id,
        "params": params,
    }

For example:

from zadu import MEASURE, make_spec

specs = [
    make_spec(MEASURE.TNC, k=20),
    make_spec(MEASURE.STRESS),
]