Skip to content

Core

stores.arrays.core.ArrayStore(path, disk_format=DiskFormat.NONE, **kwargs)

Bases: Store, ABC

Abstract interface for storing and retrieving per-ensemble and per-microstate arrays, e.g., coordinates, velocities, forces, etc.

PARAMETER DESCRIPTION
path

Container/table name.

TYPE: Path | str

disk_format

File format when writing arrays to disk.

TYPE: DiskFormat DEFAULT: NONE

kind = StoreKind.ARRAY class-attribute instance-attribute

append(path, data, **kwargs) abstractmethod

Append data to an existing array at the given path, creating it if needed. This is useful for adding new microstates one by one.

PARAMETER DESCRIPTION
path

Container/table name.

TYPE: Path | str

array

numpy array to append along the first axis.

available() abstractmethod

List all array paths/keys currently stored in this ensemble.

RETURNS DESCRIPTION
list[str]

A list of logical paths (e.g., ["coords", "velocities"]).

create(path, shape, overwrite=False, **kwargs) abstractmethod

read(path, view=None, **kwargs) abstractmethod

Retrieve the full array stored at the given path.

PARAMETER DESCRIPTION
path

Container/table name.

TYPE: Path | str

view

either a tuple of slice objects corresponding to each dimension, or a dict of {axis_index: slice} for partial reads. If None, returns the full array.

TYPE: OptionalSliceSpec DEFAULT: None

RETURNS DESCRIPTION
NDArray[generic] | None

numpy array previously stored.

write(path, data, view=None, **kwargs) abstractmethod

Write a new array at the given path. Overwrites if it exists.

PARAMETER DESCRIPTION
path

Container/table name.

TYPE: Path | str

array

numpy array to store.