SystemInterface
- class cubie.batchsolving.SystemInterface.SystemInterface(system: BaseODE)[source]
Bases:
objectLive view onto a system’s value containers.
- Parameters:
system – The ODE system whose value containers this interface reads.
Notes
The variable resolution methods interpret input values as:
Nonemeans “use all” (default behavior)[]or empty array means “explicitly no variables”When both labels and indices are provided, their union is used
- get_labels(values_object: VariableSet, indices: ndarray) List[str][source]
Return labels corresponding to the provided indices.
- merge_variable_inputs(var_labels: List[str] | None, state_indices: List[int] | ndarray | None, observable_indices: List[int] | ndarray | None) Tuple[ndarray, ndarray][source]
Merge label-based selections with index-based selections.
- Parameters:
var_labels – Variable names to resolve. None means “not provided”.
state_indices – Direct state index selection. None means “not provided”.
observable_indices – Direct observable index selection. None means “not provided”.
- Returns:
Final (state_indices, observable_indices) arrays.
- Return type:
Tuple[np.ndarray, np.ndarray]
Notes
When all three inputs are None, returns full range arrays (all states, all observables). When any input is explicitly empty ([] or empty array), that emptiness is preserved. Union of resolved labels and provided indices is returned.
- merge_variable_labels_and_idxs(output_settings: Dict[str, Any]) None[source]
Convert variable label settings to index arrays in-place.
- Parameters:
output_settings – Settings dict containing
save_variables,summarise_variables, and their index counterparts. Modified in-place.- Raises:
ValueError – If any variable labels are not found in states or observables.
Notes
Pops
save_variablesandsummarise_variablesfrom the dict and replaces index parameters with final resolved arrays. For summarised indices, defaults to saved indices when both labels and indices are None.
- observable_indices(keys_or_indices: List[str | int] | str | int | None = None, silent: bool = False) ndarray[source]
Convert observable labels or indices to a numeric array.
- Parameters:
keys_or_indices – Observable names, indices, or a mix of both.
Nonereturns all observable indices.silent – If
True, suppresses warnings for unrecognized keys or indices.
- Returns:
Array of integer indices corresponding to the provided identifiers.
- Return type:
ndarray
- observable_labels(indices: ndarray | None = None) List[str][source]
Return observable labels corresponding to the provided indices.
- property observables: VariableSet
Observables, read live from the system.
- parameter_indices(keys_or_indices: List[str | int] | str | int, silent: bool = False) ndarray[source]
Convert parameter labels or indices to a numeric array.
- Parameters:
keys_or_indices – Parameter names, indices, or a mix of both.
silent – If
True, suppresses warnings for unrecognized keys or indices.
- Returns:
Array of integer indices corresponding to the provided identifiers.
- Return type:
ndarray
- parameter_labels(indices: ndarray | None = None) List[str][source]
Return parameter labels corresponding to the provided indices.
- property parameter_legend: Dict[int, str]
Return the label of each row of the parameters array.
Each label is the swept parameter’s name, with its unit in brackets unless it is dimensionless.
- resolve_variable_labels(labels: List[str] | None, silent: bool = False) Tuple[ndarray | None, ndarray | None][source]
Resolve variable labels to separate state and observable indices.
- Parameters:
labels – Variable names that may be states or observables. If
None, returns(None, None)to signal “use defaults”. If empty list, returns empty arrays for both.silent – If
True, suppresses errors for unrecognized labels.
- Returns:
Tuple of (state_indices, observable_indices). Returns
(None, None)when labels is None.- Return type:
Tuple[Optional[np.ndarray], Optional[np.ndarray]]
- Raises:
ValueError – If any label is not found in states or observables and silent is False.
- state_indices(keys_or_indices: List[str | int] | str | int | None = None, silent: bool = False) ndarray[source]
Convert state labels or indices to a numeric array.
- Parameters:
keys_or_indices – State names, indices, or a mix of both.
Nonereturns all state indices.silent – If
True, suppresses warnings for unrecognized keys or indices.
- Returns:
Array of integer indices corresponding to the provided identifiers.
- Return type:
ndarray