Skip to content
Snippets Groups Projects
Commit d87cbcc4 authored by Stefano Di Frischia's avatar Stefano Di Frischia
Browse files

Resolve L2SS-1494 "Add gzip compression to hdf5"

parent 19b95855
No related branches found
No related tags found
1 merge request!72Resolve L2SS-1494 "Add gzip compression to hdf5"
......@@ -130,6 +130,7 @@ tox -e debug tests.requests.test_prometheus
```
## Releasenotes
- 0.17.0 - Add gzip compression to HDF5 files in statistics writer
- 0.16.3 - Fix AntennaField in filename
- 0.16.2 - Fixed MultiStationObservation.all_connected
- Renamed SDPPacket.upcast to downcast
......
0.16.3
0.17.0
......@@ -201,7 +201,11 @@ class HdfDataWriter(HdfDataReader, DataWriter):
_assert_is_dataset(data[key])
del data[key]
data.create_dataset(key, data=value)
# GZIP filter ("gzip"). Available with every installation of HDF5.
# compression_opts sets the compression level and may be an integer from 0 to 9,
# default is 4.
# https://docs.h5py.org/en/stable/high/dataset.html#lossless-compression-filters
data.create_dataset(key, data=value, compression="gzip", compression_opts=9)
if target_type is not ndarray and issubclass(target_type, ndarray):
data_writer = cls(data_writer.file_writer, data[key])
setattr(value, "_data_writer", data_writer)
......
0.6
0.7
......@@ -342,6 +342,11 @@ class TestStatisticsWriterXST(TestStatisticsReaderWriter):
"timestamp", dict(f["XST_2021-09-13T13:21:32.000"].attrs)
)
# check compression
self.assertEqual(
f["XST_2021-09-13T13:21:32.000"].compression, "gzip"
)
def test_xst_multiple_subbands(self):
with mock.patch.object(entry, "_get_tango_device", self._mock_get_tango_device):
with TemporaryDirectory() as tmpdir:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment