pub fn fold_nodes<S: AsRef<str>>(
names: &[S],
fold_axis: Option<&[i64]>,
) -> StringExpand description
Fold a list of node names into compact bracket notation, honoring a fold-axis constraint.
fold_axis is None to fold along all axes (upstream default), or
Some(axes) with 0-indexed axes (negative values resolved modulo the
dimension count), mirroring NodeSet.fold_axis semantics:
- 1D patterns fold only when
fold_axisisNoneor contains an axisxwith-1 <= x < 1; otherwise they expand. - nD patterns fold each axis in the resolved set and expand the others.
Patterns are emitted sorted alphabetically; elements within a pattern
follow RangeSet ordering, like the Python oracle.