Batched Results

Use this page when solve returns a BatchSolveResult. Each batch entry represents one set of project keys.

Start with Batched Solves to create a batch.

Batch Result Data

BatchSolveResult provides these types of result data:

Exports of BatchSolveResult data include a batch dimension.

Use to_dict() for dictionary exports from batched project-key views and to_dict() for batched postprocess views. The deprecated to_mapping() compatibility name remains available for both views, including BatchPostprocessRecord.to_mapping().

BatchSolveResult also provides:

Select Entries And Slices

Select individual entries or slices from a BatchSolveResult.

Use an index in square brackets to select one BatchSolveEntry from the BatchSolveResult. Index 0 selects the first entry:

entry = batch[0]

Use a slice, such as batch[1:4], to create another BatchSolveResult. The first number is included and the second number is excluded:

subset = batch[1:4]

The batch preserves input order. Slicing preserves the original entry indices.

Use len to get the number of batch entries and iterate over the batch to inspect each BatchSolveEntry in input order:

print(len(batch))
for entry in batch:
    print(entry.index, entry.keys)

Use success_indices and failure_indices to select entry groups.

Inspect One Entry

A BatchSolveEntry provides these attributes:

Batch Export Dimensions

The costs, eigenvalues, and postprocesses attributes follow the same rules as the corresponding SolveResult attributes. Their exports include an extra batch dimension.

Batch exports use explicit dimensions and identities:

  • batch_index identifies the original input set of project keys.

  • row_index identifies a row within one result entry.

  • is_valid marks result data that is available.

  • is_padded marks positions added to align variable-length results.

Unavailable rows use NaN values where the export format requires padding. The is_valid mask distinguishes unavailable data from solver data that is actually NaN.

Export Limits

Batch results do not provide wide-form aggregate DataFrame exports. Use long-form DataFrame methods for batch tables and postprocess rows.

See Data Exporting for general format behavior and Resultbag for cached batch acquisition.