Skip to main content

Module fold

Module fold 

Source
Expand description

nD-aware nodeset folding honoring a fold-axis constraint (--axis).

Ports the ClusterShell pieces needed by upstream commit 6ed71ac (GH#356):

  • parse_fold_axis โ€” port of CLI/Utils.py::parse_fold_axis, translating a 1-indexed command-line --axis value into 0-indexed axes suitable for NodeSet.fold_axis / Defaults.fold_axis.
  • fold_nodes โ€” port of NodeSetBase.__str__ + _iter_nd_pat rendering on top of RangeSetND vector folding (_fold_univariate / _fold_multivariate_merge). The core NodeSet eagerly expands multidimensional patterns, so the nD-aware folding needed for gathered output display is reimplemented here from the raw node-name list.

Functionsยง

fold_nodes
Fold a list of node names into compact bracket notation, honoring a fold-axis constraint.
parse_fold_axis
Port of CLI/Utils.py::parse_fold_axis.