(function from pyomo.util.slices)
pyomo.util.slices
Slice a component along the indices corresponding to some sets, wherever they appear in the component’s block hierarchy.
Given a component or component data object, for all parent components and parent blocks between the object and the context block, replace any index corresponding to a set in sets with slices or an ellipsis.
Component
ComponentData
Component whose parent structure to search and replace
Contains the sets to replace with slices
Block
BlockData
Block below which to search for sets
Slice of comp with wildcards replacing the indices of sets