Skip to content

coleman.spec.sweep

Sweep engine — grid, zip, and seed replication expansion.

coleman.spec.sweep

Sweep engine — grid, zip, and repeat expansion.

Given a base :class:RunSpec and a :class:SweepSpec, the engine produces a deterministically-ordered sequence of concrete RunSpec instances with every parameter combination materialised.

SweepAxis

Bases: BaseModel

A single sweep dimension.

Parameters:

Name Type Description Default
mode str

"grid" for Cartesian product, "zip" for element-wise pairing.

required
params dict[str, list[Any]]

Mapping of dotted parameter paths to the list of values to sweep.

required

SweepSpec

Bases: BaseModel

Multi-axis sweep definition.

Parameters:

Name Type Description Default
axes list[SweepAxis]

Sweep dimensions. Grid axes are combined via Cartesian product; zip axes are combined element-wise.

required
seeds list[int] | None

If set, each generated spec is further replicated once per seed (the seed is written to execution.seed).

required

expand_sweep

expand_sweep(base, sweep)

Expand base × sweep into a deterministic list of RunSpec.

Parameters:

Name Type Description Default
base RunSpec

Template spec to override.

required
sweep SweepSpec

Sweep definition (axes + optional seeds).

required

Returns:

Type Description
list[RunSpec]

Concrete specs in deterministic order.