OptimizationVariables.pack#

OptimizationVariables.pack(values)[source]#

Assemble a flat vector from labelled per-variable values.

Parameters:
valuesDataArray or Mapping[str, DataArray]

A mapping from variable name to labelled values. A bare DataArray is accepted when there is a single variable.

Returns:
np.ndarray

Flat vector of length size.