Skip to content

Commit

Permalink
Turn on the HDF5 shuffle filter to improve array compression.
Browse files Browse the repository at this point in the history
This follows the lead of alabaster.base's HDF5 saving, which in turn follows
the behavior of rhdf5's h5createDataset().
  • Loading branch information
LTLA committed Sep 22, 2024
1 parent ae0c353 commit 5d826ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: alabaster.matrix
Title: Load and Save Artifacts from File
Version: 1.5.9
Date: 2024-09-12
Version: 1.5.10
Date: 2024-09-22
Authors@R: person("Aaron", "Lun", role=c("aut", "cre"), email="[email protected]")
License: MIT + file LICENSE
Description:
Expand Down
1 change: 1 addition & 0 deletions R/saveArray.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ h5_write_array <- function(handle, name, x, type, placeholder, extract.native=NU
H5Pset_obj_track_times(phandle, FALSE)

if (!is.null(compress) && compress > 0 && length(x)) {
H5Pset_shuffle(phandle) # improve compression by interlacing data elements.
H5Pset_deflate(phandle, level=compress)
if (is.null(chunks)) {
chunks <- getHDF5DumpChunkDim(dim(x))
Expand Down

0 comments on commit 5d826ee

Please sign in to comment.