diff --git a/README.md b/README.md index 3e3259f2e456b9088d1c71848a8270dc999a3a61..4b2c1f521e9ded0406e1829b7e3949fa9d5628a2 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/VERSION b/VERSION index 7eb3095a3295f649df230c168c0e4fa1ae63456c..c5523bd09b187d88eb8caeb979852a301d6c2728 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.16.3 +0.17.0 diff --git a/lofar_station_client/file_access/hdf/_hdf_writers.py b/lofar_station_client/file_access/hdf/_hdf_writers.py index 0349cef7616ede9d4bae0773069ee3b420324d35..063defbd668732c959cb86233196f2c0441fa863 100644 --- a/lofar_station_client/file_access/hdf/_hdf_writers.py +++ b/lofar_station_client/file_access/hdf/_hdf_writers.py @@ -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) diff --git a/lofar_station_client/statistics/writer/VERSION b/lofar_station_client/statistics/writer/VERSION index 5a2a5806df6e909afe3609b5706cb1012913ca0e..eb49d7c7fdcbb1b4745de39837864aa7f78570ac 100644 --- a/lofar_station_client/statistics/writer/VERSION +++ b/lofar_station_client/statistics/writer/VERSION @@ -1 +1 @@ -0.6 +0.7 diff --git a/tests/statistics/test_writer.py b/tests/statistics/test_writer.py index 4333e8b073e01777057f866d57380336d46fdeeb..85978097f3052dcdd93b888f31f020519c1c70ce 100644 --- a/tests/statistics/test_writer.py +++ b/tests/statistics/test_writer.py @@ -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: