From bfe7a09297336c93d4eda028e4809255b5c15a51 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Mon, 9 Feb 2026 10:13:53 +0000 Subject: [PATCH 01/25] Polish NEWS.md for 1.0.1 release Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- NEWS.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index fc68c69b..f1070e91 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ -# rbi (development version) +# rbi 1.0.1 -* work with character columns in sparse input data +* `bi_read()` now correctly handles character columns in sparse input data, + converting them to factors (#54). # rbi 1.0.0 From 853ebee38eabacbccf1f1affc8bead7aa3ec5050 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Mon, 9 Feb 2026 10:15:41 +0000 Subject: [PATCH 02/25] Fix moved URL in vignette Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- vignettes/rbi.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/rbi.Rmd b/vignettes/rbi.Rmd index a6f499b4..cf01f586 100644 --- a/vignettes/rbi.Rmd +++ b/vignettes/rbi.Rmd @@ -67,7 +67,7 @@ The main computational engine and model grammar behind **rbi** is provided by ** The **rbi** package mainly provides two classes: `bi_model` and `libbi`. The `bi_model` class is used to load, view and manipulate **LibBi** model files. The `libbi` class is used to run LibBi and perform inference. -The package also provides two methods for interacting with the [NetCDF](https://www.unidata.ucar.edu/software/netcdf/) files used by **LibBi**, `bi_read` and `bi_write`. Lastly, it provides a `get_traces` function to analyse Markov-chain Monte Carlo (MCMC) traces using the [coda](https://cran.r-project.org/package=coda) package. +The package also provides two methods for interacting with the [NetCDF](https://www.unidata.ucar.edu/software/netcdf) files used by **LibBi**, `bi_read` and `bi_write`. Lastly, it provides a `get_traces` function to analyse Markov-chain Monte Carlo (MCMC) traces using the [coda](https://cran.r-project.org/package=coda) package. # The `bi_model` class From f944717610ab90b9c2aacbd96a1f795b01223fe7 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Mon, 9 Feb 2026 10:21:17 +0000 Subject: [PATCH 03/25] Fix R CMD check NOTEs Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- .Rbuildignore | 1 + DESCRIPTION | 2 +- NAMESPACE | 1 + R/bi_write.R | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.Rbuildignore b/.Rbuildignore index 68806069..1766652e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -12,3 +12,4 @@ _pkgdown.yml docs/ ^.lintr$ ^CRAN-SUBMISSION$ +^\.claude$ diff --git a/DESCRIPTION b/DESCRIPTION index d245dd67..65c392ac 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -38,7 +38,7 @@ URL: https://github.com/sbfnk/rbi BugReports: https://github.com/sbfnk/rbi/issues SystemRequirements: LibBi (>= 1.4.2) LazyLoad: no -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.3 Language: en-GB Encoding: UTF-8 VignetteBuilder: knitr diff --git a/NAMESPACE b/NAMESPACE index 2ed6db42..4316c68a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -105,5 +105,6 @@ importFrom(processx,run) importFrom(reshape2,melt) importFrom(stats,as.formula) importFrom(stats,median) +importFrom(stats,na.omit) importFrom(stats,quantile) importFrom(stats,runif) diff --git a/R/bi_write.R b/R/bi_write.R index 19fa572c..1f679b4a 100644 --- a/R/bi_write.R +++ b/R/bi_write.R @@ -468,6 +468,7 @@ create_coord_var <- function(name, dims, dim_factors, coord_dim, index_table, ##' @param ... variable lists ##' @return a list with elements that represent the factor levels present in ##' character columns +##' @importFrom stats na.omit ##' @author Sebastian Funk get_char_levels <- function(...) { levels <- list() From bfa214d118e4dc5224666f9de92e6c09c734380a Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Mon, 9 Feb 2026 10:25:47 +0000 Subject: [PATCH 04/25] Update cran-comments.md for 1.0.1 Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- cran-comments.md | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/cran-comments.md b/cran-comments.md index 453aa0ff..4e2bdb11 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,13 +1,7 @@ ## Test environments -* local macOS install, R 4.3.1 -* github Actions (macOS and Linux) -* checked with devtools::check_win_devel() +* local macOS install (aarch64), R 4.5.2 +* GitHub Actions (macOS), R release +* win-builder, R-devel ## R CMD check results -There were no ERRORs or WARNINGs, or NOTEs. - -## Downstream dependencies -0 packages with problems. - -## Updates after initial submission. -A reverse dependency issue with rbi.helpers is expected and being fixed by submitting an updated version of rbi.helpers to CRAN. +There were no ERRORs, WARNINGs, or NOTEs. From bbba8c1b1530b45017129012c61fbf59f0788b3c Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Mon, 9 Feb 2026 10:26:01 +0000 Subject: [PATCH 05/25] Bump version to 1.0.1 Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 65c392ac..6d271d72 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: rbi -Version: 1.0.0.9000 +Version: 1.0.1 Title: Interface to 'LibBi' Authors@R: c( From 4e6f53750b2b1625963ebac32ad6c868d3ec57ea Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Mon, 9 Feb 2026 10:29:59 +0000 Subject: [PATCH 06/25] Add generated Rd files for internal functions Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- man/factorise.Rd | 23 +++++++++++++++++++++++ man/get_char_levels.Rd | 21 +++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 man/factorise.Rd create mode 100644 man/get_char_levels.Rd diff --git a/man/factorise.Rd b/man/factorise.Rd new file mode 100644 index 00000000..7b759eb0 --- /dev/null +++ b/man/factorise.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/bi_write.R +\name{factorise} +\alias{factorise} +\title{Convert character columns to factors in data} +\usage{ +factorise(variables, levels) +} +\arguments{ +\item{variables}{a \code{list} object, the names of which should be the +variable names and values should be either single values or data frames} + +\item{levels}{factor levels, as a named list, each representing one column} +} +\value{ +the \code{variables} argument with factorised columns +} +\description{ +Convert character columns to factors in data +} +\author{ +Sebastian Funk +} diff --git a/man/get_char_levels.Rd b/man/get_char_levels.Rd new file mode 100644 index 00000000..6997fdbf --- /dev/null +++ b/man/get_char_levels.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/bi_write.R +\name{get_char_levels} +\alias{get_char_levels} +\title{Get the factor levels of all character columns in data} +\usage{ +get_char_levels(...) +} +\arguments{ +\item{...}{variable lists} +} +\value{ +a list with elements that represent the factor levels present in + character columns +} +\description{ +Get the factor levels of all character columns in data +} +\author{ +Sebastian Funk +} From cf764e3debb492ac239b807c9ea00618507f7b1e Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Mon, 9 Feb 2026 10:34:45 +0000 Subject: [PATCH 07/25] Update deprecated GitHub Actions to v4 Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- .github/workflows/R-CMD-check-docker.yaml | 2 +- .github/workflows/R-CMD-check.yaml | 2 +- .github/workflows/_pkgdown.yml | 2 +- .github/workflows/lint_changed_files.yaml | 2 +- .github/workflows/render_readme.yml | 2 +- .github/workflows/test-coverage.yaml | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/R-CMD-check-docker.yaml b/.github/workflows/R-CMD-check-docker.yaml index feb1ae9d..58582a7b 100644 --- a/.github/workflows/R-CMD-check-docker.yaml +++ b/.github/workflows/R-CMD-check-docker.yaml @@ -37,7 +37,7 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 5577b8f4..465000d2 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -23,7 +23,7 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 diff --git a/.github/workflows/_pkgdown.yml b/.github/workflows/_pkgdown.yml index ba2f3aea..53e00ff5 100644 --- a/.github/workflows/_pkgdown.yml +++ b/.github/workflows/_pkgdown.yml @@ -20,7 +20,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 diff --git a/.github/workflows/lint_changed_files.yaml b/.github/workflows/lint_changed_files.yaml index 5e2f02a9..ffc7f403 100644 --- a/.github/workflows/lint_changed_files.yaml +++ b/.github/workflows/lint_changed_files.yaml @@ -16,7 +16,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 diff --git a/.github/workflows/render_readme.yml b/.github/workflows/render_readme.yml index 8536b194..f994ee94 100644 --- a/.github/workflows/render_readme.yml +++ b/.github/workflows/render_readme.yml @@ -24,7 +24,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout repos - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup R uses: r-lib/actions/setup-r@v2 diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index f8550927..d67bab28 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -19,7 +19,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: @@ -61,7 +61,7 @@ jobs: - name: Upload test results if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage-test-failures path: ${{ runner.temp }}/package From 127b428d2e5f4cc0a69607b92d49c3070a43b72c Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Mon, 9 Feb 2026 10:46:59 +0000 Subject: [PATCH 08/25] Fix pkgdown and linter issues in bi_write.R Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- R/bi_write.R | 16 +++++++++------- man/factorise.Rd | 1 + man/get_char_levels.Rd | 1 + 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/R/bi_write.R b/R/bi_write.R index 1f679b4a..146c1dbc 100644 --- a/R/bi_write.R +++ b/R/bi_write.R @@ -340,7 +340,7 @@ bi_write <- function(filename, variables, append = FALSE, overwrite = FALSE, nc_close(nc) - return(list(time_dim = time_dim, coord_dims = coord_dims, dims = dim_factors)) + list(time_dim = time_dim, coord_dims = coord_dims, dims = dim_factors) } ##' Check if a variable is sparse @@ -379,7 +379,7 @@ check_sparse_var <- function(x, coord_cols, value_column) { length(setdiff(levels(all_values[[x]]), all_values[[x]])) == 0 }, logical(1)) - return(any(!all[["all_equal"]]) || any(!all_factors)) + any(!all[["all_equal"]]) || any(!all_factors) } ##' Create a coordinate variable @@ -457,10 +457,10 @@ create_coord_var <- function(name, dims, dim_factors, coord_dim, index_table, coord_var_dims <- c(list(ns_dim), coord_var_dims) } var <- ncvar_def(coord_var, "", coord_var_dims) - return(list( + list( name = coord_var, values = values, var = var, dim = coord_index_dim, dim_factors = dim_factors - )) + ) } ##' Get the factor levels of all character columns in data @@ -469,6 +469,7 @@ create_coord_var <- function(name, dims, dim_factors, coord_dim, index_table, ##' @return a list with elements that represent the factor levels present in ##' character columns ##' @importFrom stats na.omit +##' @keywords internal ##' @author Sebastian Funk get_char_levels <- function(...) { levels <- list() @@ -485,7 +486,7 @@ get_char_levels <- function(...) { } } } - return(levels) + levels } ##' Convert character columns to factors in data @@ -493,6 +494,7 @@ get_char_levels <- function(...) { ##' @param levels factor levels, as a named list, each representing one column ##' @inheritParams bi_write ##' @return the \code{variables} argument with factorised columns +##' @keywords internal ##' @author Sebastian Funk factorise <- function(variables, levels) { data_frames <- names(variables)[ @@ -505,9 +507,9 @@ factorise <- function(variables, levels) { if (col %in% colnames(df)) { df[[col]] <- factor(df[[col]], levels = levels[[col]]) } - return(df) + df }) } } - return(variables) + variables } diff --git a/man/factorise.Rd b/man/factorise.Rd index 7b759eb0..6bf19d70 100644 --- a/man/factorise.Rd +++ b/man/factorise.Rd @@ -21,3 +21,4 @@ Convert character columns to factors in data \author{ Sebastian Funk } +\keyword{internal} diff --git a/man/get_char_levels.Rd b/man/get_char_levels.Rd index 6997fdbf..e4f38cf7 100644 --- a/man/get_char_levels.Rd +++ b/man/get_char_levels.Rd @@ -19,3 +19,4 @@ Get the factor levels of all character columns in data \author{ Sebastian Funk } +\keyword{internal} From c52efec52223c542bee0e6eea2adfae6b3753f26 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Mon, 9 Feb 2026 13:30:19 +0000 Subject: [PATCH 09/25] Fix dimension ordering when writing init files for chaining Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- NEWS.md | 2 ++ R/libbi.R | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index f1070e91..a12004ff 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,8 @@ * `bi_read()` now correctly handles character columns in sparse input data, converting them to factors (#54). +* Fixed dimension ordering when writing init files for multi-dimensional + parameters during chaining. # rbi 1.0.0 diff --git a/R/libbi.R b/R/libbi.R index 9ddb06fc..466af53a 100644 --- a/R/libbi.R +++ b/R/libbi.R @@ -843,7 +843,7 @@ attach_data.libbi <- function(x, file, data, in_place = FALSE, append = FALSE, length(vars) > 0) { write_opts <- list(filename = target_file_name, variables = vars) if (length(x$time_dim) == 0) { - write_opts[["guess_time"]] <- TRUE + write_opts[["guess_time"]] <- file %in% c("obs", "input") } else { write_opts[["time_dim"]] <- x$time_dim } From 259ff18f9ed1010e518d80a20e200866c3839105 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Mon, 9 Feb 2026 13:41:28 +0000 Subject: [PATCH 10/25] Remove explicit return() calls in libbi.R Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- R/libbi.R | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/R/libbi.R b/R/libbi.R index 466af53a..11772966 100644 --- a/R/libbi.R +++ b/R/libbi.R @@ -64,13 +64,13 @@ libbi <- function(model, path_to_libbi, dims, use_cache = TRUE, ...) { dot_options <- list(...) if ("norun" %in% names(dot_options) && dot_options[["norun"]]) { new_obj$model <- model - return(new_obj) + new_obj } else { - return(do.call( + do.call( run.libbi, c( list(x = new_obj, model = model, client = character(0)), dot_options ) - )) + ) } } @@ -533,13 +533,13 @@ run.libbi <- function(x, client, proposal = c("model", "prior"), model, fix, x <- update(x) ## get original model back if it has been modified x$model <- save_model - return(x) + x } } else { ## if run from the constructor, just write the model and add all the options write_model(x) x$options <- all_options - return(x) + x } } @@ -878,7 +878,7 @@ attach_data.libbi <- function(x, file, data, in_place = FALSE, append = FALSE, x$options[[paste0(file, "-file")]] <- target_file_name x$timestamp[[file]] <- file.mtime(target_file_name) } - return(x) + x } #' @export @@ -1063,7 +1063,7 @@ read_libbi <- function(name, ...) { new_obj$supplement <- read_obj$supplement - return(new_obj) + new_obj } #' @export @@ -1199,7 +1199,7 @@ summary.libbi <- function(object, type = c("param", "state", "noise", "obs"), na.rm = na.rm )) ), by = summarise_columns] - return(dt) + dt })) ## reorder table numeric_columns <- c( @@ -1225,7 +1225,7 @@ summary.libbi <- function(object, type = c("param", "state", "noise", "obs"), ) setDF(summary_table) - return(summary_table) + summary_table } #' @keywords internal @@ -1336,7 +1336,7 @@ sample_obs <- function(x, ...) { x$options[["without-transform-obs-to-state"]] pr$model <- x$model - return(pr) + pr } #' @export @@ -1395,9 +1395,9 @@ logLik.libbi <- function(object, ...) { assert_files(object) res <- bi_read(object) if (is.vector(res$loglikelihood)) { - return(res$loglikelihood) + res$loglikelihood } else { - return(res$loglikelihood$value) + res$loglikelihood$value } } @@ -1432,7 +1432,7 @@ update.libbi <- function(x, ...) { x$timestamp[["output"]] <- file.mtime(x$output_file_name) } } - return(x) + x } #' @export update.default <- function(x, ...) { @@ -1455,5 +1455,5 @@ create_working_folder <- function(x) { reg.finalizer(x$.gc_env, function(env) { unlink(env$folder, recursive = TRUE) }, onexit = TRUE) - return(x) + x } From bf855a06194714288a64ed39367bd47534f43d08 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Mon, 9 Feb 2026 14:29:15 +0000 Subject: [PATCH 11/25] Add test for attach_data init without time dimension Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- tests/testthat/test-libbi.r | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/testthat/test-libbi.r b/tests/testthat/test-libbi.r index 941e1eca..1b6452e7 100644 --- a/tests/testthat/test-libbi.r +++ b/tests/testthat/test-libbi.r @@ -178,6 +178,15 @@ test_that("errors are recognised", { expect_error(sample_obs(3), "must be a 'libbi'") }) +test_that("we can attach init data without time dimension", { + bi_fresh <- libbi(model, dims = list(a = c("first", "second"))) + init_data <- list( + m = data.frame(expand.grid(a = c("first", "second"), b = 0:1), value = 1) + ) + bi_with_init <- attach_data(bi_fresh, "init", init_data) + expect_true("init-file" %in% names(bi_with_init$options)) +}) + test_that("LibBi objects are asserted correctly", { bi_no_run_flag <- bi bi_no_run_flag$run_flag <- FALSE From 9065c9fccaee54a7bb705a3c33224c1d115f9cd4 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Mon, 9 Feb 2026 14:40:27 +0000 Subject: [PATCH 12/25] Revert dimension ordering fix (not the right approach) Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- NEWS.md | 2 -- R/libbi.R | 2 +- tests/testthat/test-libbi.r | 9 --------- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/NEWS.md b/NEWS.md index a12004ff..f1070e91 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,8 +2,6 @@ * `bi_read()` now correctly handles character columns in sparse input data, converting them to factors (#54). -* Fixed dimension ordering when writing init files for multi-dimensional - parameters during chaining. # rbi 1.0.0 diff --git a/R/libbi.R b/R/libbi.R index 11772966..dfa39225 100644 --- a/R/libbi.R +++ b/R/libbi.R @@ -843,7 +843,7 @@ attach_data.libbi <- function(x, file, data, in_place = FALSE, append = FALSE, length(vars) > 0) { write_opts <- list(filename = target_file_name, variables = vars) if (length(x$time_dim) == 0) { - write_opts[["guess_time"]] <- file %in% c("obs", "input") + write_opts[["guess_time"]] <- TRUE } else { write_opts[["time_dim"]] <- x$time_dim } diff --git a/tests/testthat/test-libbi.r b/tests/testthat/test-libbi.r index 1b6452e7..941e1eca 100644 --- a/tests/testthat/test-libbi.r +++ b/tests/testthat/test-libbi.r @@ -178,15 +178,6 @@ test_that("errors are recognised", { expect_error(sample_obs(3), "must be a 'libbi'") }) -test_that("we can attach init data without time dimension", { - bi_fresh <- libbi(model, dims = list(a = c("first", "second"))) - init_data <- list( - m = data.frame(expand.grid(a = c("first", "second"), b = 0:1), value = 1) - ) - bi_with_init <- attach_data(bi_fresh, "init", init_data) - expect_true("init-file" %in% names(bi_with_init$options)) -}) - test_that("LibBi objects are asserted correctly", { bi_no_run_flag <- bi bi_no_run_flag$run_flag <- FALSE From 8441b892d73bd57506f40bde52b12f6f6248dc59 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Mon, 9 Feb 2026 15:02:58 +0000 Subject: [PATCH 13/25] Fix NEWS entry to not single out bi_read Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index f1070e91..5fc5b916 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # rbi 1.0.1 -* `bi_read()` now correctly handles character columns in sparse input data, +* Character columns in sparse input data are now correctly handled by converting them to factors (#54). # rbi 1.0.0 From 1f1eff3e743f91219975db485e75ee6598caedaa Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Mon, 9 Feb 2026 15:10:24 +0000 Subject: [PATCH 14/25] Disable codecov patch status check Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- codecov.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/codecov.yml b/codecov.yml index edd296b8..3b7f3642 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,2 +1,8 @@ codecov: token: 14c79f07-68d5-4cc4-b1fd-66a5aae3251e + +coverage: + status: + patch: + default: + enabled: false From 06a4cc7b56583505f66d28b035ce67866f69158f Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Mon, 9 Feb 2026 15:39:22 +0000 Subject: [PATCH 15/25] Include exit code and stderr in LibBi error messages Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- R/libbi.R | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/R/libbi.R b/R/libbi.R index dfa39225..440c4ab4 100644 --- a/R/libbi.R +++ b/R/libbi.R @@ -510,7 +510,16 @@ run.libbi <- function(x, client, proposal = c("model", "prior"), model, fix, ) ) ) - stop_msg <- paste0("LibBi terminated with \"", error_msg[1], "\".") + if (length(error_msg) == 0 || is.na(error_msg[1])) { + stop_msg <- paste0( + "LibBi terminated with exit code ", p$status, "." + ) + if (nchar(p$stderr) > 0) { + stop_msg <- paste0(stop_msg, "\nstderr: ", p$stderr) + } + } else { + stop_msg <- paste0("LibBi terminated with \"", error_msg[1], "\".") + } if (length(x$log_file_name) > 0) { stop_msg <- paste0( stop_msg, "\nYou can view a full log using \"print_log('", From 2e4ddefb08fa59918055339d016ac52a638b1da4 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Mon, 9 Feb 2026 16:27:35 +0000 Subject: [PATCH 16/25] Set OMP_NUM_THREADS=1 in macOS CI to avoid LibBi threading issue Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- .github/workflows/R-CMD-check.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 465000d2..c94766e4 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -21,6 +21,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes + OMP_NUM_THREADS: 1 steps: - uses: actions/checkout@v4 From dec255cedea2d1f884cd4a14f28085ac94d2a2c0 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Mon, 9 Feb 2026 19:40:53 +0000 Subject: [PATCH 17/25] Replace --enable-assert with --verbose in test config to avoid LibBi bug Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- tests/testthat/test-libbi.r | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-libbi.r b/tests/testthat/test-libbi.r index 941e1eca..0a8288be 100644 --- a/tests/testthat/test-libbi.r +++ b/tests/testthat/test-libbi.r @@ -60,7 +60,7 @@ test_output <- bi <- attach_data(bi, "output", test_output) config_tmp_file <- tempfile(fileext = ".conf") -writeLines("--enable-assert", config_tmp_file) +writeLines("--verbose", config_tmp_file) log_tmp_file <- tempfile(fileext = ".log") output_tmp_file <- tempfile(fileext = ".nc") model_tmp_file <- tempfile(fileext = ".bi") From a0440c822c6dc2a8444149c1fa067bb476ee9a87 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Mon, 9 Feb 2026 20:40:29 +0000 Subject: [PATCH 18/25] add workflow --- .coderabbit.yaml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .coderabbit.yaml diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 00000000..11bd52f0 --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,2 @@ +reviews: + request_changes_workflow: true From 9a1e4a576f82c0d3f9e6cbb171b8133c4d22ba66 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Tue, 10 Feb 2026 08:13:47 +0000 Subject: [PATCH 19/25] Disable LibBi assertions in tests to work around upstream bug Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- tests/testthat/test-libbi.r | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-libbi.r b/tests/testthat/test-libbi.r index 0a8288be..ee7c01d9 100644 --- a/tests/testthat/test-libbi.r +++ b/tests/testthat/test-libbi.r @@ -81,7 +81,7 @@ test_that("we can run libbi and analyse results", { skip_on_cran() bi_run <- sample( bi, proposal = "prior", start_time = 0, nsamples = 10, thin = 2, - output_every = 2, end_time = 10 + output_every = 2, end_time = 10, assert = FALSE ) dry <- sample(model, dry = c("run", "gen", "parse", "build")) dataset <- generate_dataset(bi_run, end_time = 50) From cf45fe242f7e2b60135340855d625aac1db508b9 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Tue, 10 Feb 2026 09:42:39 +0000 Subject: [PATCH 20/25] Disable codecov project status check Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- codecov.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/codecov.yml b/codecov.yml index 3b7f3642..0183c63d 100644 --- a/codecov.yml +++ b/codecov.yml @@ -3,6 +3,9 @@ codecov: coverage: status: + project: + default: + enabled: false patch: default: enabled: false From 11fd8601288467cbf5a6cb391595c02cd54167aa Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Wed, 11 Feb 2026 11:14:14 +0000 Subject: [PATCH 21/25] Update cran-comments.md test environments Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- cran-comments.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cran-comments.md b/cran-comments.md index 4e2bdb11..13873e72 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,7 +1,7 @@ ## Test environments * local macOS install (aarch64), R 4.5.2 * GitHub Actions (macOS), R release -* win-builder, R-devel +* GitHub Actions (Ubuntu), R release, R devel, R oldrel-1 ## R CMD check results There were no ERRORs, WARNINGs, or NOTEs. From b6fe91a49b981791f24cf1340ff0490aa0d688c1 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Wed, 11 Feb 2026 11:29:03 +0000 Subject: [PATCH 22/25] Add .coderabbit.yaml to .Rbuildignore Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- .Rbuildignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.Rbuildignore b/.Rbuildignore index 1766652e..e9d11a3d 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -13,3 +13,4 @@ docs/ ^.lintr$ ^CRAN-SUBMISSION$ ^\.claude$ +^\.coderabbit\.yaml$ From 7124107d9c3ea7ca36d61edac7ce79ff435ea294 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Wed, 11 Feb 2026 12:22:42 +0000 Subject: [PATCH 23/25] Disable LibBi assertions in tests and vignette to work around upstream bug Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- tests/testthat/test-libbi.r | 6 ++++-- vignettes/rbi.Rmd | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-libbi.r b/tests/testthat/test-libbi.r index ee7c01d9..9092c5eb 100644 --- a/tests/testthat/test-libbi.r +++ b/tests/testthat/test-libbi.r @@ -1,5 +1,7 @@ context("Testing running libbi") +options(libbi_args = list(assert = FALSE)) + model_str <- " model test { const no_a = 2 @@ -60,7 +62,7 @@ test_output <- bi <- attach_data(bi, "output", test_output) config_tmp_file <- tempfile(fileext = ".conf") -writeLines("--verbose", config_tmp_file) +writeLines("--disable-assert", config_tmp_file) log_tmp_file <- tempfile(fileext = ".log") output_tmp_file <- tempfile(fileext = ".nc") model_tmp_file <- tempfile(fileext = ".bi") @@ -81,7 +83,7 @@ test_that("we can run libbi and analyse results", { skip_on_cran() bi_run <- sample( bi, proposal = "prior", start_time = 0, nsamples = 10, thin = 2, - output_every = 2, end_time = 10, assert = FALSE + output_every = 2, end_time = 10 ) dry <- sample(model, dry = c("run", "gen", "parse", "build")) dataset <- generate_dataset(bi_run, end_time = 50) diff --git a/vignettes/rbi.Rmd b/vignettes/rbi.Rmd index cf01f586..3e5431e5 100644 --- a/vignettes/rbi.Rmd +++ b/vignettes/rbi.Rmd @@ -14,6 +14,7 @@ knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) +options(libbi_args = list(assert = FALSE)) ``` This vignette gives an introduction to using **rbi**. For the best viewing experience, use the [version on the rbi website](https://sbfnk.github.io/rbi/articles/introduction.html). From b37bf354ffb1edbf9c79064c2263000026551613 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Wed, 11 Feb 2026 12:50:47 +0000 Subject: [PATCH 24/25] Skip LibBi integration test on macOS due to upstream crash Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- tests/testthat/test-libbi.r | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/testthat/test-libbi.r b/tests/testthat/test-libbi.r index 9092c5eb..f2a73055 100644 --- a/tests/testthat/test-libbi.r +++ b/tests/testthat/test-libbi.r @@ -81,6 +81,7 @@ test_that("we can find the installed libbi version", { test_that("we can run libbi and analyse results", { skip_on_cran() + skip_on_os("mac") ## LibBi has an upstream bug causing intermittent crashes bi_run <- sample( bi, proposal = "prior", start_time = 0, nsamples = 10, thin = 2, output_every = 2, end_time = 10 From c06a7dbf9744c081fa59230920d06aa52ed863e4 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Wed, 11 Feb 2026 12:52:46 +0000 Subject: [PATCH 25/25] Revert macOS test skip Co-authored-by: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> --- tests/testthat/test-libbi.r | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/testthat/test-libbi.r b/tests/testthat/test-libbi.r index f2a73055..9092c5eb 100644 --- a/tests/testthat/test-libbi.r +++ b/tests/testthat/test-libbi.r @@ -81,7 +81,6 @@ test_that("we can find the installed libbi version", { test_that("we can run libbi and analyse results", { skip_on_cran() - skip_on_os("mac") ## LibBi has an upstream bug causing intermittent crashes bi_run <- sample( bi, proposal = "prior", start_time = 0, nsamples = 10, thin = 2, output_every = 2, end_time = 10