nnpd.core.settings

Explicit one-factor-at-a-time sweeps. Ordinary lists are literal values.

Classes

Choice

An atomic sweep knob: Choice([baseline, alternative, ...]).

Variant

Functions

canonical(→ str)

Stable JSON; reject NaN, infinity, callables, and ambiguous custom objects.

digest(→ str)

at(→ Any)

select(→ dict)

expand_sweep(→ list[Variant])

Baseline once, then one changed knob per run; never a Cartesian product.

single(→ dict)

Settings that must be one value everywhere: reject any Choice.

load_settings(→ dict)

Load a trusted Python settings file; this executes Python, not a sandbox.

default_profile(→ str)

Module Contents

nnpd.core.settings.canonical(value: Any) → str

Stable JSON; reject NaN, infinity, callables, and ambiguous custom objects.

nnpd.core.settings.digest(value: Any) → str
class nnpd.core.settings.Choice

An atomic sweep knob: Choice([baseline, alternative, …]).

Values may themselves be lists or dictionaries (e.g. complete architectures). Nesting Choice inside an option is deliberately unsupported.

values: list[Any] | tuple[Any, ...]
class nnpd.core.settings.Variant
settings: dict
changed: str | None
value: Any = None
property id: str
nnpd.core.settings.at(settings: dict, path: str) → Any
nnpd.core.settings.select(settings: dict, *paths: str) → dict
nnpd.core.settings.expand_sweep(settings: dict) → list[Variant]

Baseline once, then one changed knob per run; never a Cartesian product.

Dictionary insertion order determines presentation order, not run identity. Duplicate resolved settings are removed, including repeated baselines.

nnpd.core.settings.single(settings: dict, name: str) → dict

Settings that must be one value everywhere: reject any Choice.

nnpd.core.settings.load_settings(path: str | pathlib.Path, profile: str | None = None) → dict

Load a trusted Python settings file; this executes Python, not a sandbox.

nnpd.core.settings.default_profile(path: str | pathlib.Path) → str