Skip to content

config

diapason.learning.optimize.config

TOML config loader for optimization runs.

load_benchmark_specs(data)

Extract benchmark specs from a loaded optimization config.

Supports two formats: - Multi-benchmark: [[optimize.benchmarks]] array of tables - Single-benchmark fallback: optimize.benchmark string

Returns a list of :class:BenchmarkSpec (from trial_runner). Returns an empty list if no benchmarks are configured (caller should fall back to CLI --benchmark).

load_objectives(data)

Extract objectives from a loaded optimization config.

Reads optimize.objectives (a list of tables) and returns a list of :class:ObjectiveSpec. Falls back to :data:DEFAULT_OBJECTIVES if the key is absent.

load_optimize_config(path)

Load an optimization config TOML file.

Returns the raw dict with keys such as optimize.max_trials, optimize.benchmark, optimize.search, optimize.fixed, optimize.constraints, etc.

Raises:

Type Description
FileNotFoundError

If path does not exist.