Skip to content

Commit

Permalink
fix nbytes
Browse files Browse the repository at this point in the history
  • Loading branch information
h-mayorquin committed May 2, 2024
1 parent 6e6a84c commit 89fd978
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hdmf/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,10 @@ def html_table(item_dicts) -> str:
hdf5_dataset = array
chunks = hdf5_dataset.chunks
compression = hdf5_dataset.compression
uncompressed_size = hdf5_dataset.nbytes
if hasattr(hdf5_dataset, "nbytes"): # TODO, remove if statement when and if h5py 3.0 is minimal
uncompressed_size = hdf5_dataset.nbytes
else:
uncompressed_size = hdf5_dataset.size * hdf5_dataset.dtype.itemsize
compression_opts = hdf5_dataset.compression_opts
compressed_size = hdf5_dataset.id.get_storage_size()
compression_ratio = uncompressed_size / compressed_size if compressed_size != 0 else "undefined"
Expand Down

0 comments on commit 89fd978

Please sign in to comment.