(group)
| 65 | |
| 66 | |
| 67 | def process_hdf5_sparse_matrix(group): |
| 68 | data = group['data'][()] |
| 69 | shape = tuple(group['shape'][()]) |
| 70 | if 'row' in group and 'col' in group: |
| 71 | row = group['row'][()] |
| 72 | col = group['col'][()] |
| 73 | return scipy.sparse.coo_matrix((data, (row, col)), shape=shape) |
| 74 | elif 'blocksize' in group: |
| 75 | indices = group['indices'][()] |
| 76 | indptr = group['indptr'][()] |
| 77 | blocksize = tuple(group['blocksize'][()]) |
| 78 | return scipy.sparse.bsr_matrix((data, indices, indptr), |
| 79 | shape=shape, |
| 80 | blocksize=blocksize) |
| 81 | else: |
| 82 | indices = group['indices'][()] |
| 83 | indptr = group['indptr'][()] |
| 84 | return scipy.sparse.csr_matrix((data, indices, indptr), shape=shape) |
| 85 | |
| 86 | |
| 87 | def process_hdf5_datagroup(group): |
no outgoing calls
no test coverage detected