gunz_cm.io package

Submodules

gunz_cm.io.gnz module

Reader and Writer for the .gnz unified container format.

Examples

class gunz_cm.io.gnz.GnzReader(fpath: str | Path)[source]

Bases: object

Class GnzReader.

Examples

Notes

get_array(name: str, mode: str = 'r') memmap[source]

Function get_array.

Examples

Notes

get_metadata() dict[source]

Function get_metadata.

Examples

Notes

keys() List[str][source]

Function keys.

Examples

Notes

class gunz_cm.io.gnz.GnzWriter(fpath: str | Path, overwrite: bool = False)[source]

Bases: object

Class GnzWriter.

Examples

Notes

add_array(name: str, data: ndarray, dtype: str | dtype | None = None)[source]

Register a complete array to be written. Data is not written until write() is called.

Examples

get_array_writable(name: str) memmap[source]

Returns a writable memmap for a specific array in the container.

Examples

init_streaming_array(name: str, shape: Tuple[int, ...], dtype: str | dtype)[source]

Reserve space for an array to be written incrementally.

Examples

set_metadata(meta: dict)[source]

Function set_metadata.

Examples

Notes

write()[source]

Finalize the header and layout, and open the file for writing.

Examples

Module contents

class gunz_cm.io.GnzReader(fpath: str | Path)[source]

Bases: object

Class GnzReader.

Examples

Notes

get_array(name: str, mode: str = 'r') memmap[source]

Function get_array.

Examples

Notes

get_metadata() dict[source]

Function get_metadata.

Examples

Notes

keys() List[str][source]

Function keys.

Examples

Notes

class gunz_cm.io.GnzWriter(fpath: str | Path, overwrite: bool = False)[source]

Bases: object

Class GnzWriter.

Examples

Notes

add_array(name: str, data: ndarray, dtype: str | dtype | None = None)[source]

Register a complete array to be written. Data is not written until write() is called.

Examples

get_array_writable(name: str) memmap[source]

Returns a writable memmap for a specific array in the container.

Examples

init_streaming_array(name: str, shape: Tuple[int, ...], dtype: str | dtype)[source]

Reserve space for an array to be written incrementally.

Examples

set_metadata(meta: dict)[source]

Function set_metadata.

Examples

Notes

write()[source]

Finalize the header and layout, and open the file for writing.

Examples