Skip to content

Commit 44d91d7

Browse files
committed
.
1 parent 6f835e5 commit 44d91d7

25 files changed

+639
-43
lines changed

ChangeLog

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
Version 0.1.5
1+
Version 0.1.6 (2025-11-19)
2+
* Minor fix: for complex vectors with attributes header was written twice in `qd_save`
3+
* Minor fix: for non-UTF8 environments and non-ascii strings and using `stringfish` ALTREP, `qd_save` was not correctly translating to UTF8
4+
* Add zstd file utilities `zstd_compress_file` and `zstd_decompress_file`
5+
* Add `tests/utility_testing.R` to test additional utility functions
6+
7+
Version 0.1.5 (2025-03-07)
28
* Fix `_u8` literal operator to align with C++23 (-Wdeprecated-literal-operator)
39
* Add global parameters for serialization arguments, see `Global Options for qs2` in the README / vignette
410

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: qs2
22
Type: Package
33
Title: Efficient Serialization of R Objects
4-
Version: 0.1.5
5-
Date: 2025-3-6
4+
Version: 0.1.6
5+
Date: 2025-11-19
66
Authors@R: c(
77
person("Travers", "Ching", email = "traversc@gmail.com", role = c("aut", "cre", "cph")),
88
person("Yann", "Collet", role = c("ctb", "cph"), comment = "Yann Collet is the author of the bundled zstd"),
@@ -24,7 +24,7 @@ Suggests: knitr, rmarkdown, dplyr, data.table, stringi
2424
SystemRequirements: GNU make
2525
Encoding: UTF-8
2626
Roxygen: list(markdown = TRUE)
27-
RoxygenNote: 7.3.2
27+
RoxygenNote: 7.3.3
2828
VignetteBuilder: knitr
2929
Copyright: This package includes code from the 'zstd' library owned by Facebook, Inc. and created by Yann Collet; and code derived from the 'Blosc' library created and owned by Francesc Alted.
3030
URL: https://github.com/qsbase/qs2

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,24 @@ install:
5353
R CMD build . # --no-build-vignettes
5454
R CMD INSTALL $(BUILD) --configure-args="--with-simd=AVX2 --with-TBB"
5555

56+
install-arm:
57+
find . -type f -exec chmod 644 {} \;
58+
find . -type d -exec chmod 755 {} \;
59+
chmod 755 cleanup
60+
chmod 755 configure
61+
# find src/ -type f -exec chmod 644 {} \;
62+
# chmod 644 ChangeLog DESCRIPTION Makefile NAMESPACE README.md
63+
./configure
64+
./cleanup
65+
Rscript -e "library(Rcpp); compileAttributes('.');"
66+
Rscript -e "devtools::load_all(); roxygen2::roxygenise('.');"
67+
find . -iname "*.a" -exec rm {} \;
68+
find . -iname "*.o" -exec rm {} \;
69+
find . -iname "*.so" -exec rm {} \;
70+
R CMD build . # --no-build-vignettes
71+
R CMD INSTALL $(BUILD) --configure-args="--with-TBB"
72+
73+
5674
install-compile-zstd:
5775
find . -type f -exec chmod 644 {} \;
5876
find . -type d -exec chmod 755 {} \;
@@ -96,3 +114,4 @@ vignette:
96114
test:
97115
Rscript tests/qs_savem_testing.R
98116
QS_EXTENDED_TESTS=1 Rscript tests/correctness_testing.R; unset QS_EXTENDED_TESTS
117+
Rscript tests/utility_testing.R

NAMESPACE

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@ export(qx_dump)
1212

1313
export(qopt)
1414

15-
export("qs_to_rds")
16-
export("rds_to_qs")
15+
export(qs_to_rds)
16+
export(rds_to_qs)
1717

18-
export("zstd_compress_raw")
19-
export("zstd_decompress_raw")
20-
export("zstd_compress_bound")
21-
export("blosc_shuffle_raw")
22-
export("blosc_unshuffle_raw")
23-
export("xxhash_raw")
18+
export(zstd_compress_file)
19+
export(zstd_decompress_file)
20+
21+
export(zstd_compress_raw)
22+
export(zstd_decompress_raw)
23+
export(zstd_compress_bound)
24+
export(blosc_shuffle_raw)
25+
export(blosc_unshuffle_raw)
26+
export(xxhash_raw)
2427

2528
export(base85_decode)
2629
export(base85_encode)
@@ -32,4 +35,4 @@ export(encode_source)
3235

3336
import(stringfish)
3437
importFrom(Rcpp,evalCpp)
35-
useDynLib(qs2, .registration = TRUE)
38+
useDynLib(qs2, .registration = TRUE)

R/RcppExports.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,11 @@ c_base91_decode <- function(encoded_string) {
145145
.Call(`_qs2_c_base91_decode`, encoded_string)
146146
}
147147

148+
zstd_compress_file <- function(input_file, output_file, compress_level = qopt("compress_level")) {
149+
invisible(.Call(`_qs2_zstd_compress_file`, input_file, output_file, compress_level))
150+
}
151+
152+
zstd_decompress_file <- function(input_file, output_file) {
153+
invisible(.Call(`_qs2_zstd_decompress_file`, input_file, output_file))
154+
}
155+

R/zstd_file_functions.R

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#' Zstd file compression
2+
#'
3+
#' A utility function to compresses a file with zstd.
4+
#'
5+
#' @usage zstd_compress_file(input_file, output_file, compress_level = qopt("compress_level"))
6+
#'
7+
#' @param input_file Path to the file to compress.
8+
#' @param output_file Path for the compressed file.
9+
#' @param compress_level The compression level used.
10+
#'
11+
#' @return No value is returned. The file is written to disk.
12+
#' @export
13+
#' @name zstd_compress_file
14+
#'
15+
#' @examples
16+
#' infile <- tempfile()
17+
#' writeBin(as.raw(1:5), infile)
18+
#' outfile <- tempfile()
19+
#' zstd_compress_file(infile, outfile, compress_level = 1)
20+
#' stopifnot(file.exists(outfile))
21+
NULL
22+
23+
#' Zstd file decompression
24+
#'
25+
#' A utility function to decompresses a zstd file to disk.
26+
#'
27+
#' @usage zstd_decompress_file(input_file, output_file)
28+
#'
29+
#' @param input_file Path to the zstd file.
30+
#' @param output_file Path for the decompressed file.
31+
#'
32+
#' @return No value is returned. The file is written to disk.
33+
#' @export
34+
#' @name zstd_decompress_file
35+
#'
36+
#' @examples
37+
#' infile <- tempfile()
38+
#' writeBin(as.raw(1:5), infile)
39+
#' zfile <- tempfile()
40+
#' zstd_compress_file(infile, zfile, compress_level = 1)
41+
#' outfile <- tempfile()
42+
#' zstd_decompress_file(zfile, outfile)
43+
#' stopifnot(identical(readBin(infile, what = "raw", n = 5), readBin(outfile, what = "raw", n = 5)))
44+
NULL

man/qd_deserialize.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/qd_read.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/qd_save.Rd

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/qd_serialize.Rd

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)