GridUtilsMixin#

class grids.mixins.core.GridUtilsMixin[source]#

Grid mixin class for supporting various utilities, validators, etc. for use in grid subclasses.

Methods

__init__()

broadcast_array_to_axes(array, axes_in, ...)

Reshape and broadcast an array aligned with axes_in so it is compatible with axes_out.

broadcast_arrays_to_axes(arrays, axes_in, ...)

Broadcast multiple arrays aligned to axes_in so they are compatible with axes_out.

broadcast_shape_to_axes(shape, axes_in, axes_out)

Expand an input shape aligned to axes_in so it is broadcastable against axes_out.

broadcast_shapes_to_axes(shapes, axes_in, ...)

Broadcast multiple input shapes aligned to axes_in so they are compatible with axes_out.

check_field_shape(array_shape[, axes, ...])

Validate that a field array shape is compatible with the grid over the specified axes.

compute_coords_from_index(index, /[, axes, ...])

Compute the physical coordinates at a specific grid index.

compute_coords_from_slices(slices, /[, ...])

Compute coordinate arrays over a region of the grid specified by slice objects.

compute_domain_centers([axes, origin, ...])

Return coordinate center arrays along each axis.

compute_domain_coords([axes, origin, ...])

Compute the 1D coordinate arrays for the full extent of the grid domain along the selected axes.

compute_domain_edges([axes, origin, ...])

Return coordinate edge arrays along each axis.

compute_domain_mesh([axes, origin, __validate__])

Compute a meshgrid of coordinate arrays spanning the full domain of the grid.

compute_domain_slice([axes, include_ghosts, ...])

Compute a slice representing the entire grid domain with some set of axes, halo offsets, and ghost zone behavior.

compute_mesh_from_slices(slices, /[, axes, ...])

Compute coordinate arrays over a region of the grid specified by slice objects.

construct_domain_interpolator(field, field_axes)

Construct an interpolator object over the entire grid domain on a particular subset of axes.

determine_domain_shape([axes, ...])

Compute the shape of the domain along specified axes, including ghost zones and optional halo padding.

empty([element_shape, axes, include_ghosts, ...])

Return an uninitialized array shaped to match a domain-aligned region of the grid.

full(fill_value, /[, element_shape, axes, ...])

Return a constant-valued array shaped to match a domain-aligned region of the grid.

ones([element_shape, axes, include_ghosts, ...])

Return an array of ones shaped to match a domain-aligned region of the grid.

show()

Alias for summary() to allow interactive/quick display.

standardize_axes([axes])

Standardize the axes provided.

summary()

Print a summary of the grid structure, including domain shape, chunking, coordinate system, and ghost zone information.

tile_array_to_axes(array, axes_in, axes_out, ...)

Tile a lower-dimensional array across the full domain of the grid defined by axes_out.

zeros([element_shape, axes, include_ghosts, ...])

Return an array of zeros shaped to match a domain-aligned region of the grid.