ommx.experiment#
ommx.experiment records an optimization experiment as one OMMX Artifact.
Use it when a single source problem produces several runs, for example
different formulations, decomposition strategies, disabled constraints, or
solver settings, and you want the resulting Artifact to answer:
which shared dataset or baseline configuration was used,
which run-level parameters should be compared as a table,
which input
ommx.Instancewas actually solved or sampled, andwhich output
ommx.Solutionorommx.SampleSetand adapter options came from each solver or sampler call.
An Experiment is a mutable session until it is committed. Experiment-level
attachments store shared context, while each Run stores scalar parameters,
run-level attachments, and zero or more Solve and Sampling records. Use
Run.log_parameter(...) for values that should become columns in
Experiment.run_parameters_df(), and use attachment methods for payloads such
as JSON, instances, solutions, sample sets, logs, or caller-defined media
types. Run.log_solve(...) calls an ommx.adapter.SolverAdapter, stores the
original input instance and returned solution, and records adapter keyword
arguments as solve metadata rather than run parameters.
Run.log_sample(...) similarly records a sampler call as a separate Sampling
whose output is the complete SampleSet.
Use Run as a context manager so closing the block records whether that trial
finished, failed, or was interrupted. Experiment may also be used as a
context manager for batch scripts, but interactive workflows often keep one
Experiment open across notebook cells and call commit() explicitly after
reviewing the closed runs. Run-close draft checkpoints are written after every
Run by default; AutosavePolicy can batch, rate-limit, or disable them for
large sweeps. On exceptional with Experiment(...) exit, OMMX
publishes a checkpoint instead of advancing the success ref. A committed
experiment is read-only. To add runs to a committed experiment, create a child
session with Experiment.fork(...). Use Experiment.rename(...) to choose or
update the local registry image reference before saving or pushing.
Classes
Name |
Description |
|---|---|
Policy controlling rolling draft checkpoints after a Run closes. |
|
A collection of optimization experiment records stored as one OMMX Artifact. |
|
A Local Registry checkpoint that can restore an uncommitted Experiment. |
|
A local-registry image reference that points to an Experiment artifact. |
|
Context manager for a manually executed Solve inside a Run. |
|
A mutable run being recorded inside an unsealed Experiment. |
|
Immutable record of one sampler call. |
|
Immutable view of a closed Run in an Experiment. |
|
Immutable record of one solver call. |
Functions
Name |
Description |
|---|---|
List internal Experiment checkpoints by requested image name and lifecycle |
|
List Experiment refs using the Local Registry's digest-addressed JSON cache. |