Storage Interface

class finalfusion.storage.storage.Storage[source]

Common interface to finalfusion storage types.

abstract property shape

Get the shape of the storage.

Returns

shape – Tuple containing (rows, columns)

Return type

Tuple[int, int]

classmethod load(file: BinaryIO, mmap: bool = False)finalfusion.storage.storage.Storage[source]

Load Storage from the given finalfusion file.

Parameters
  • file (IO[bytes]) – Finalfusion file with a storage chunk

  • mmap (bool)

Returns

  • storage (Storage) – The first storage in the input file

  • mmap (bool) – Toggles memory mapping the storage buffer as read-only.

Raises

ValueError – If the file did not contain a storage.

abstract static mmap_chunk(file: BinaryIO)finalfusion.storage.storage.Storage[source]

Memory maps the storage as a read-only buffer.

Parameters

file (IO[bytes]) – Finalfusion file with a storage chunk

Returns

storage – The first storage in the input file

Return type

Storage

Raises

ValueError – If the file did not contain a storage.