grids.mixins.core.GridUtilsMixin.broadcast_arrays_to_axes#
- GridUtilsMixin.broadcast_arrays_to_axes(arrays: Sequence[ndarray], axes_in: Sequence[AxesInput], axes_out: AxesInput) Sequence[ndarray] [source]#
Broadcast multiple arrays aligned to axes_in so they are compatible with axes_out.
This pluralized version of
broadcast_array_to_axes()
takes a sequence of arrays and corresponding axis specifications and returns arrays reshaped to be broadcastable over a common target axis layout.- Parameters:
arrays (
sequence
ofnp.ndarray
) – A list of arrays to reshape and broadcast. Each array’s leading dimensions must align with the corresponding entry in axes_in. Trailing dimensions are preserved.axes_in (
sequence
ofAxesInput
) – A list of axis specifications for the input arrays.axes_out (
AxesInput
) – The target axes into which all arrays will be broadcast-compatible.
- Returns:
The broadcast-compatible arrays, each reshaped according to the axes_out layout.
- Return type:
sequence
ofnp.ndarray
- Raises:
ValueError – If the input shapes and axes are incompatible or misaligned.