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 loation 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