fields.mixins.components.FieldComponentCoreMixin.broadcast_to_array_in_axes#

FieldComponentCoreMixin.broadcast_to_array_in_axes(axes: AxesInput, **kwargs) ndarray[source]#

Return the field data as a NumPy array broadcasted to a specified set of axes.

This reshapes the array so that its leading dimensions align with axes, inserting singleton dimensions as necessary to ensure compatibility.

Parameters:
  • axes (list of str) – Target axes to broadcast the array over.

  • **kwargs – Additional keyword arguments passed to np.broadcast_to.

Returns:

The buffer contents as a NumPy array aligned with the given axes.

Return type:

np.ndarray