Result Sets¶
result_set
¶
Result set management for creating and managing subsets of optimization data.
Result sets allow users to create named subsets of optimization results for focused analysis, comparison, and decision making.
Classes¶
SetOperation
¶
Bases: BaseModel
Record of an operation that created or modified a set.
ResultSet
¶
Bases: BaseModel
A named subset of optimization results.
Result sets reference indices in the parent OptimizationResult and can be created through filtering, manual selection, or algorithmic identification (e.g., Pareto front detection).
Functions¶
__len__
¶
add_operation
¶
Record an operation in the set's history.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
operation
|
str
|
Type of operation |
required |
parameters
|
dict[str, Any]
|
Operation parameters |
required |
description
|
str | None
|
Optional description |
None
|
Source code in optiscope/core/result_set.py
union
¶
Create a new set as the union of this set and another.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
ResultSet
|
Another ResultSet |
required |
name
|
str
|
Name for the new set |
required |
Returns:
| Type | Description |
|---|---|
ResultSet
|
New ResultSet containing union of indices |
Source code in optiscope/core/result_set.py
intersection
¶
Create a new set as the intersection of this set and another.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
ResultSet
|
Another ResultSet |
required |
name
|
str
|
Name for the new set |
required |
Returns:
| Type | Description |
|---|---|
ResultSet
|
New ResultSet containing intersection of indices |
Source code in optiscope/core/result_set.py
difference
¶
Create a new set as the difference (this - other).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
ResultSet
|
Another ResultSet |
required |
name
|
str
|
Name for the new set |
required |
Returns:
| Type | Description |
|---|---|
ResultSet
|
New ResultSet containing difference of indices |
Source code in optiscope/core/result_set.py
filter_by_mask
¶
filter_by_mask(mask: ndarray, name: str, description: str | None = None) -> ResultSet
Create a new set by filtering current set with a boolean mask.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mask
|
ndarray
|
Boolean mask array (length must match this set) |
required |
name
|
str
|
Name for new set |
required |
description
|
str | None
|
Optional description |
None
|
Returns:
| Type | Description |
|---|---|
ResultSet
|
New filtered ResultSet |
Source code in optiscope/core/result_set.py
to_dict
¶
Export set as dictionary.
Source code in optiscope/core/result_set.py
from_dict
classmethod
¶
from_dict(data: dict[str, Any]) -> ResultSet
Create ResultSet from dictionary.
Source code in optiscope/core/result_set.py
SetManager
¶
Manager for handling multiple result sets.
Provides utilities for creating, managing, and performing operations on collections of result sets.
Source code in optiscope/core/result_set.py
Functions¶
remove_set
¶
Remove a result set.