avni.tools.io module#
- avni.tools.io.close_h5py()[source]#
Close all h5py files
- Authors
Raj Moulik (moulik@caa.columbia.edu)
- Last Modified
2023.02.16 5.00
- avni.tools.io.store_sparse_hdf(h5f, varname: str, mat, compression: str = 'gzip')[source]#
Store a csr matrix in HDF5
- Parameters
- h5f
HDF5 file handle
- varnamestr
node prefix in HDF5 hierarchy
- matscipy.sparse.csr.csr_matrix
sparse matrix to be stored
- compressionstr, optional
Compression type in HDF5, by default “gzip”
- :Authors:
Raj Moulik (moulik@caa.columbia.edu)
- :Last Modified:
2023.02.16 5.00
- avni.tools.io.load_sparse_hdf(h5f, varname: str)[source]#
Load a csr matrix from HDF5 file
- Parameters
- h5f
HDF5 file handle
- varnamestr
node prefix in HDF5 hierarchy
- Returns
- scipy.sparse.csr.csr_matrix
A sparse csr matrix
- Authors
Raj Moulik (moulik@caa.columbia.edu)
- Last Modified
2023.02.16 5.00
- avni.tools.io.store_numpy_hdf(h5f, varname: str, array: numpy.ndarray, compression: str = 'gzip', compression_opts: int = 9)[source]#
Store a named numpy array in HDF5 file
- Parameters
- h5f
HDF5 file handle
- varnamestr
node prefix in HDF5 hierarchy
- arraynp.ndarray
Named numpy array
- compressionstr, optional
Compression type in HDF5, by default “gzip”
- compression_optsint, optional
Compression level opts, by default 9
- :Authors:
Raj Moulik (moulik@caa.columbia.edu)
- :Last Modified:
2023.02.16 5.00
- avni.tools.io.load_numpy_hdf(h5f, varname: str) numpy.ndarray [source]#
Read a named numpy array from HDF5 file
- Parameters
- h5f
HDF5 file handle
- varnamestr
node prefix in HDF5 hierarchy
- Returns
- np.ndarray
Named numpy array
- Authors
Raj Moulik (moulik@caa.columbia.edu)
- Last Modified
2023.02.16 5.00