Skip to main content
A SimplePipeline is a lightweight alternative to the full Pipeline when your workflow has at most one expensive element — a single DataFit or Validation. It gives you fire-and-forget execution with a flat result containing parameter_values, cost, and optional summary_stats.

When to Use

Use SimplePipelineUse Pipeline
At most one DataFit or ValidationMultiple DataFit / Validation elements
Fire-and-forget executionPer-element status tracking
Flat parameter_values resultCumulative parameter threading

Building a Config

Use ionworks_schema to build a typed, validated config. SimplePipeline inherits everything from Pipeline and adds client-side validation that rejects configs with more than one expensive element.
import ionworks_schema as iws

objective = iws.objectives.CurrentDriven(data_input="path/to/discharge.csv")

pipeline = iws.SimplePipeline(
    elements={
        "initial_params": iws.direct_entries.DirectEntry(
            parameters={"Negative particle diffusivity [m2.s-1]": 2e-14},
        ),
        "fit": iws.DataFit(
            objectives={"cycle": objective},
            parameters={
                "Negative particle diffusivity [m2.s-1]": iws.Parameter(
                    "Negative particle diffusivity [m2.s-1]",
                    bounds=(1e-14, 1e-13),
                    initial_value=2e-14,
                )
            },
            cost=iws.costs.RMSE(),
            optimizer=iws.parameter_estimators.ScipyDifferentialEvolution(
                maxiter=10
            ),
        ),
    },
    name="My Fit",
)

config = pipeline.to_config()
If you pass more than one DataFit or Validation element, SimplePipeline raises a ValueError immediately — no need to wait for a server-side rejection.

Submitting and Polling

from ionworks import Ionworks

client = Ionworks()

# Submit the config
sp = client.simple_pipeline.create(config, name=pipeline.name)
# sp.status == "pending"

# Wait for completion (polls automatically)
result = client.simple_pipeline.wait_for_completion(sp.id, timeout=600)

# Read results
print(result.result["parameter_values"])
# {"Negative particle diffusivity [m2.s-1]": 5.3e-14}
print(result.result["cost"])

Validation Pipelines

SimplePipeline also supports a single Validation element. The result includes summary_stats alongside parameter_values.
objective = iws.objectives.CurrentDriven(data_input="path/to/cycle.csv")

validation_pipeline = iws.SimplePipeline(
    elements={
        "validate": iws.Validation(
            objectives={"cycle": objective},
        ),
    },
    name="Validate fitted model",
)

sp = client.simple_pipeline.create(
    validation_pipeline.to_config(), name=validation_pipeline.name
)
result = client.simple_pipeline.wait_for_completion(sp.id, timeout=600)
print(result.result["summary_stats"])

API Reference

For the full schema API, see the ionworks-schema documentation.