Skip to content

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

Open
@h-mayorquin

Description

@h-mayorquin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    category: bugerrors in the code or code behaviorpriority: lowalternative solution already working and/or relevant to only specific user(s)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions