grids.mixins.core#

Core mixins for the PyMetric grid infrastructure.

This module contains mixin classes that are included (by default) in the core GridBase class and are therefore structural elements of the base class. These are primarily a method for ensuring that code structure is coherent and readable on the developer end. Mixins manage

  • Coordinate system introspection and axis normalization

  • Unit system access and serialization

  • Ghost zone and halo management

  • Chunking behavior and iteration

  • HDF5 input/output operations

  • Index validation and vectorized access utilities

Each mixin expects the parent class to implement specific attributes (e.g., __cs__, __dd__, __ghost_dd__, etc.) that are required for it to function correctly. These mixins follow a minimal and declarative style, avoiding unnecessary side effects or object instantiation.

Each mixin is typed with Generic[...] bounds on their expected protocols.

Classes

GridIOMixin()

Mixin class to support basic IO methods for grids.

GridPlotMixin()

Mixin class for plotting 2D projections of structured coordinate grids.

GridUtilsMixin()

Grid mixin class for supporting various utilities, validators, etc.