coordinates.mixins.core.CoordinateSystemAxesMixin.resolve_axes#

CoordinateSystemAxesMixin.resolve_axes(axes: Sequence[str] | None = None, *, require_subset: bool = True, require_order: bool = False) List[str][source]#

Normalize and validate a user-supplied list of axis names.

This utility resolves the canonical ordering and performs consistency checks such as subset membership, uniqueness, and order compliance.

Parameters:
  • axes (list of str or None) – The axis names to validate. If None, returns the full list of canonical axes (self.axes).

  • require_subset (bool, default True) – If True, all entries in axes must be present in self.axes.

  • require_order (bool, default False) – If True, axes must appear in the same order as they do in self.axes.

Returns:

A concrete list of axis names, validated and normalized.

Return type:

list of str

Raises:

ValueError – If duplicate, unknown, or misordered axes are found.

Examples

>>> from pymetric.coordinates import SphericalCoordinateSystem
>>> cs = SphericalCoordinateSystem()
>>> cs.resolve_axes(["phi", "r"])
['phi', 'r']
>>> cs.resolve_axes(["phi", "r"], require_order=True)  
ValueError: Axes must appear in canonical order r → theta → phi; received ['phi', 'r']