fields.buffers.core.HDF5Buffer.flatten#

HDF5Buffer.flatten(*args, order='C', inplace: bool = False, **kwargs) BufferBase[source]#

Return a flattened 1D view of this buffer.

This flattens the buffer using the specified memory layout and returns a new buffer instance.

Parameters:
  • order ({'C', 'F', 'A', 'K'}, default 'C') – Memory layout to use when flattening: - ‘C’ → row-major (C-style), - ‘F’ → column-major (Fortran-style), - ‘A’ → ‘F’ if input is Fortran contiguous, else ‘C’, - ‘K’ → as close to input layout as possible.

  • *args – Additional positional arguments forwarded to from_array().

  • inplace (bool, optional) – If True, values for file, name, and overwrite are ignored; the dataset underlying the calling buffer is directly replaced and the object is updated and returned in-place.

  • **kwargs – Additional keyword arguments forwarded to and from_array(). If inplace is True, then these are forwarded to replace_dataset().

Returns:

A new 1D buffer.

Return type:

BufferBase