ionworks-api Python package provides a sub-client for running and managing optimizations programmatically. For installation and authentication, see the Python API client page.
Running an optimization
Waiting for completion
wait_for_completion polls until the optimization reaches a terminal
status (succeeded, failed, or canceled) and returns the optimization
resource. By default it raises IonworksError
on failed or canceled; set raise_on_failure=False to get the result
dict back instead.
Listing optimizations
When
project_id is omitted, client.optimization.run and .list
use the default project configured on
the Ionworks client.Getting an optimization
Returns the optimization resource as a flat dictionary. The lifecyclestatus is one of queued, running, succeeded, failed, or
canceled. Result metrics and error are populated once the
optimization reaches a terminal state.
The response used to be split into separate
optimization and job
keys. The job is no longer exposed — status, metrics, and error
now live on the optimization resource itself. Update any code that
reads result["job"]["status"] to read result["status"].Updating an optimization
Inspecting the parameter trace
Design optimizations and data fits log the optimizer’s per-iteration progress to the job’s metadata. This is the same data that powers the parameter and cost-convergence plots in Studio. Useclient.job.get_parameter_trace to pull it down as a list of dicts (one per
saved iteration, oldest first):
Saves are throttled (roughly every 100 iterations or every 5 seconds), so the
trace is a sampled subset of the optimizer’s evaluations rather than every
single one. The list is empty when live progress updates were disabled for
the run, and there is no per-iteration wall-clock timing.