modelrunner.storage.backend.memory module

Defines a class storing data in memory.

class MemoryStorage(*, mode='insert')[source]

Bases: StorageBase

Store items in memory.

Parameters:

mode (str or AccessMode) – The file mode with which the storage is accessed. Determines allowed operations.

clear()[source]

Truncate the storage by removing all stored data.

Parameters:

clear_data_shape (bool) – Flag determining whether the data shape is also deleted.

Return type:

None

is_group(loc)[source]

Determine whether the location is a group.

Parameters:

loc (sequence of str) – A list of strings determining the location in the storage

Returns:

True if the location is a group

Return type:

bool

keys(loc)[source]

Return all sub-items defined at a given location.

Parameters:

loc (sequence of str) – A list of strings determining the location in the storage

Returns:

a list of all items defined at this location

Return type:

list