FieldComponentCoreMixin#
- class fields.mixins.components.FieldComponentCoreMixin[source]#
Core mixin methods for the
FieldComponent
class.This class handles various entry point methods, some utility methods, etc.
Methods
__init__
()broadcast_buffer_to_axes
(axes, *args[, ...])Return a new buffer instance with data broadcasted to a specified set of axes.
broadcast_to_array_in_axes
(axes, **kwargs)Return the field data as a NumPy array broadcasted to a specified set of axes.
broadcast_to_buffer_core_in_axes
(axes, **kwargs)Return the core backend array (e.g., NumPy, HDF5) broadcasted to a specified set of axes.
broadcast_to_buffer_repr_in_axes
(axes, **kwargs)Return the NumPy-compatible buffer representation broadcasted to specified axes.
broadcast_to_unyt_array_in_axes
(axes, **kwargs)Return the field data as a unit-aware unyt_array broadcasted to specified axes.
convert_to_base
([unit_system, equivalence])Convert the buffer to base units of a given system (in-place).
convert_to_units
(units[, equivalence])Convert the component’s buffer to the specified units (in-place).
empty
(grid, axes, *args[, element_shape, ...])Create a component with an empty buffer.
empty_like
(other, *args, **kwargs)Create an empty component with the same grid, axes, and element shape as another.
expand_axes
(axes, *args[, out, ...])Broadcast and tile an existing
FieldComponent
to an expanded set of axes.from_array
(array_like, grid, axes, *args[, ...])Construct a
FieldComponent
from an existing array-like object.from_function
(func, grid, axes, *args[, ...])Construct a
FieldComponent
by evaluating a function on the grid.full
(grid, axes, *args[, fill_value, ...])Create a component filled with a particular fill value.
full_like
(other, *args, **kwargs)Create a full-valued component with the same grid, axes, and element shape as another.
in_units
(units, *args[, as_array, ...])Return a version of this component in the specified physical units.
ones
(grid, axes, *args[, element_shape, ...])Create a component filled with ones.
ones_like
(other, *args, **kwargs)Create a one-filled component with the same grid, axes, and element shape as another.
reduce_axes
(axes, indices, *args[, ...])Reduce a component to a smaller set of axes by slicing.
reshape_element
(new_element_shape, *args, ...)Reshape the element-wise portion of the buffer (i.e., trailing dimensions) to a new shape.
to
(units, *args[, equivalence, ...])Alias for in_units.
to_value
(units[, equivalence])Return the buffer contents in the specified units, stripped of unit tags.
zeros
(grid, axes, *args[, element_shape, ...])Create a component filled with zeros.
zeros_like
(other, *args, **kwargs)Create a zero-filled component with the same grid, axes, and element shape as another.