coordinates.mixins.core.CoordinateSystemAxesMixin.get_free_fixed#

CoordinateSystemAxesMixin.get_free_fixed(axes: Sequence[str] | None = None, *, fixed_axes: Dict[str, Any] | None = None) Tuple[List[str], Dict[str, Any]][source]#

Split a list of coordinate axes into fixed and free components.

This utility verifies that all fixed axes are: - present in the coordinate system - included in the axes list being considered

It then returns a list of free axes (i.e., axes not fixed) and the fixed axis dictionary.

Parameters:
  • axes (list of str, optional) – The axes to consider. If not provided, uses all coordinate system axes.

  • fixed_axes (dict of {str: Any}, optional) – A mapping of fixed axis names to values.

Returns:

A tuple of (free_axes, fixed_axes) where: - free_axes is a list of axes in axes that are not fixed. - fixed_axes is the same dictionary (possibly empty), but validated.

Return type:

(list of str, dict of str Any)

Raises:

ValueError – If any fixed axis is not in the coordinate system. If any fixed axis is not in the provided axes list.

Examples

>>> from pymetric.coordinates import SphericalCoordinateSystem
>>> cs = SphericalCoordinateSystem()
>>> cs.get_free_fixed(axes=["r", "theta", "phi"], fixed_axes={"theta": 0.0})
(['r', 'phi'], {'theta': 0.0})