xbout.xarraybackend.BoutADIOSBackendArray¶
- class xbout.xarraybackend.BoutADIOSBackendArray(shape, dtype, lock, adiosfile, varname, *, cast_dtype=None)[source]¶
Bases:
BackendArrayLazily indexed array backed by an ADIOS2 Variable.
xarray calls
__getitem__with anExplicitIndexer; this class maps the indexer into ADIOS2set_step_selection(for time/steps) andset_selection(for spatial dimensions), then reads the selection.- Parameters:
shape (list)
dtype (np.dtype)
adiosfile (FileReader)
varname (str)
cast_dtype (np.dtype | None)
- __init__(shape, dtype, lock, adiosfile, varname, *, cast_dtype=None)[source]¶
- Parameters:
shape (list) – Full xarray-visible shape. If the ADIOS2 variable has steps, the first dimension is the synthetic xarray time dimension.
dtype (np.dtype) – Numpy dtype used by ADIOS2 for the stored variable.
lock – Optional lock for thread-safety. ADIOS2 reads are not thread-safe.
adiosfile (FileReader) – Open ADIOS2
FileReaderhandle.varname (str) – Name of the ADIOS2 variable to read.
cast_dtype (np.dtype | None) – Optional dtype to cast to after reading (used to round-trip types that are stored differently on disk, e.g.
boolstored asuint8).
Methods
__init__(shape, dtype, lock, adiosfile, ...)async_get_duck_array([dtype])async_getitem(key)get_duck_array([dtype])Attributes
ndimNumber of array dimensions.
sizeNumber of elements in the array.