pg_utils.numerics.io.matrices_save_h5

pg_utils.numerics.io.matrices_save_h5(fwrite: Group, matrix: Union[ndarray, coo_array, coo_matrix], f_attrs: dict = {}, rows: Optional[dict] = None, cols: Optional[dict] = None) None[source]

Save matrices to h5py file/group. This is the main interface for saving matrices as h5py object.

Parameters:
  • fwrite (h5py.Group) – an h5py group object for writing

  • f_attrs (dict) – attributes of the group

  • rows (Optional[dict]) – blocks of rows. Default is None, then no row info will be stored. If not None, the dict will be interpreted as a dict with keys “names” and “ranges”, which specifies the names of the row blocks and ranges of the row blocks.

  • cols (Optional[dict]) – blocks of cols, see rows.

  • **kwargs – key-value pairs of matrix name - matrix val