replace_indices

(function from pyomo.util.slices)

pyomo.util.slices.replace_indices(index, location_set_map, sets)[source]

Use location_set_map to replace values in index with slices or an Ellipsis.

Parameters:

index: tuple or scalar

Index whose values to replace

location_set_map: dict

Maps locations (“indices”) within the index to their corresponding set

sets: pyomo.common.collections.ComponentSet

Contains the sets to replace with slices

Returns:

tuple: Index with values replaced by slices