hdmf icon indicating copy to clipboard operation
hdmf copied to clipboard

HTML data representation is not showing compression enabled for Blosc with zstd5

Open h-mayorquin opened this issue 8 months ago • 0 comments

It does not display the compression settings for in-memory files:

import numpy as np
import hdf5plugin
from pynwb import TimeSeries
from pynwb.testing.mock.file import mock_NWBFile
from hdmf.backends.hdf5.h5_utils import H5DataIO

# Sample data
data = np.arange(1000)
timestamps = np.arange(1000)


# Wrap data with BLOSC + Zstd level 5
wrapped_data = H5DataIO(
    data=data,
    **hdf5plugin.Blosc(cname="zstd", clevel=5),
    allow_plugin_filters=True,
)

# Add TimeSeries with compressed data
ts = TimeSeries(
    name="compressed_timeseries",
    data=wrapped_data,
    unit="SIunit",
    timestamps=timestamps,
)

nwbfile = mock_NWBFile()
nwbfile.add_acquisition(ts)
nwbfile.acquisition["compressed_timeseries"]

Output:

Image

And neither it does it for the files after reading from disk:

from pynwb import NWBHDF5IO
from pynwb import read_nwb
with NWBHDF5IO("compressed_timeseries.nwb", "w") as io:
    io.write(nwbfile)
    
read_nwb("compressed_timeseries.nwb").acquisition["compressed_timeseries"]

Image

h-mayorquin avatar May 07 '25 18:05 h-mayorquin