CoordinateSystemAxesMixin#

class coordinates.mixins.core.CoordinateSystemAxesMixin[source]#

Mixin class for coordinates.core.CurvilinearCoordinateSystem which provides support for axis manipulation and logic in coordinate systems.

This class defines a comprehensive suite of methods for manipulating and validating axis names, indices, masks, permutations, and orderings in the context of a coordinate system. It is designed to be mixed into coordinate system base classes in the Pisces Geometry library.

Key Capabilities#

  • Convert between axis names and numeric indices.

  • Build and interpret boolean axis masks.

  • Validate and normalize axis inputs (with optional order enforcement).

  • Compute permutations and reorderings for axes and associated data.

  • Insert or complete axis-aligned iterables using fixed axes.

  • Provide LaTeX representations of axes for display purposes.

Methods

__init__()

axes_complement(axes)

Return all axes in the coordinate system that are not present in axes.

build_axes_mask(axes)

Construct a boolean mask array indicating which axes are in axes.

convert_axes_to_indices(axes)

Convert axis name(s) to their corresponding index or indices.

convert_indices_to_axes(axes_indices)

Convert axis index or indices to their corresponding axis name(s).

get_axes_from_mask(mask)

Convert a boolean axis mask into a list of axis names.

get_axes_latex(axes)

Return the LaTeX representation(s) of one or more axis names.

get_axes_order(src_axes, dst_axes)

Compute the reordering indices that will reorder src_axes into the order of dst_axes.

get_axes_permutation(src_axes, dst_axes)

Compute the permutation needed to reorder src_axes into dst_axes.

get_axes_units(unit_system)

Resolve the physical units for each axis in a given unit system.

get_canonical_axes_order(src_axes)

Compute the permutation indices to reorder src_axes into sorted alphabetical order.

get_canonical_axes_permutation(axes)

Compute the permutation needed to reorder axes into the canonical order defined by the coordinate system.

get_free_fixed([axes, fixed_axes])

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

get_indices_from_mask(mask)

Convert a boolean mask of length ndim back to numeric indices.

get_mask_from_axes(axes)

Return a boolean mask of shape (ndim,) with True on the positions corresponding to axes.

get_mask_from_indices(indices)

Boolean mask that is True at the supplied numeric indices.

in_axes_order(iterable, src_axes, dst_axes)

Reorder a sequence of values from src_axes order to dst_axes order.

in_canonical_order(iterable, src_axes)

Reorder a sequence of values from src_axes order to canonical axis order.

insert_fixed_axes(iterable, src_axes[, ...])

Insert fixed axis values into an iterable of values according to canonical axis order.

is_axes_subset(axes_a, axes_b)

Check if axes_a is a subset of axes_b.

is_axes_superset(axes_a, axes_b)

Check if axes_a is a superset of axes_b.

is_axis(axis)

Check whether the given axis name(s) exist in this coordinate system.

order_axes(src_axes, dst_axes)

Reorder src_axes into the order defined by dst_axes.

order_axes_canonical(src_axes)

Reorder a list of axis names into the canonical order of this coordinate system.

resolve_axes([axes, require_subset, ...])

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