nir.serialization#

Module Contents#

Functions#

try_byte_to_str(→ Union[str, Any])

read_node(→ nir.NIRNode)

Read a graph from a HDF/conn5 file.

hdf2dict(→ Dict[str, Any])

read(→ nir.NIRGraph)

Load a NIR from a HDF/conn5 file.

read_version(→ str)

Reads the filename of a given NIR file, and raises an exception if the version

write(→ None)

Write a NIR to a HDF5 file.

nir.serialization.try_byte_to_str(a: Union[bytes, Any]) Union[str, Any]#
Parameters

a (Union[bytes, Any]) –

Return type

Union[str, Any]

nir.serialization.read_node(node: Any) nir.NIRNode#

Read a graph from a HDF/conn5 file.

Parameters

node (Any) –

Return type

nir.NIRNode

nir.serialization.hdf2dict(node: Any) Dict[str, Any]#
Parameters

node (Any) –

Return type

Dict[str, Any]

nir.serialization.read(filename: Union[str, pathlib.Path]) nir.NIRGraph#

Load a NIR from a HDF/conn5 file.

Parameters

filename (Union[str, pathlib.Path]) –

Return type

nir.NIRGraph

nir.serialization.read_version(filename: Union[str, pathlib.Path]) str#

Reads the filename of a given NIR file, and raises an exception if the version does not exist in the file.

Parameters

filename (Union[str, pathlib.Path]) –

Return type

str

nir.serialization.write(filename: Union[str, pathlib.Path, io.RawIOBase], graph: nir.NIRNode) None#

Write a NIR to a HDF5 file.

Parameters
  • filename (Union[str, pathlib.Path, io.RawIOBase]) –

  • graph (nir.NIRNode) –

Return type

None