pysdic.Connectivity.keep_elements_by_index#
- Connectivity.keep_elements_by_index(indices, *, propagate_properties=True)[source]#
Keep only the elements with the given indices.
Note
The elements keep their original order and duplicated indices are ignored:
keep_elements_by_index([2, 0])returns the elements 0 and 2, in this order.- Parameters:
indices (ArrayLike) – An integer array of shape \((R,)\) with the indices of the elements to keep, in \([0, N_e)\).
propagate_properties (bool, optional (default:
True)) – If False, the new connectivity has no properties.
- Returns:
The connectivity with only the given elements.
- Return type:
- Raises:
TypeError – If the indices are not integers.
IndexError – If an index is out of \([0, N_e)\).