coordinates.coordinate_systems.CartesianCoordinateSystem3D.get_canonical_axes_order#
- static CartesianCoordinateSystem3D.get_canonical_axes_order(src_axes: Sequence[str]) List[int] #
Compute the permutation indices to reorder src_axes into sorted alphabetical order.
This function is useful for contexts where canonical order is alphabetical, or where symbolic systems (without a defined canonical axis list) use string sorting as a fallback.
- Parameters:
- Returns:
A permutation P such that [src_axes[i] for i in P] gives sorted(src_axes).
- Return type:
Examples
>>> get_canonical_axes_order(["theta", "r", "phi"]) [2, 1, 0]