diff --git a/DESCRIPTION b/DESCRIPTION index 529b963c..4ba6affb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: naomi Title: Naomi Model for Subnational HIV Estimates -Version: 2.9.24 +Version: 2.9.25 Authors@R: person(given = "Jeff", family = "Eaton", diff --git a/NEWS.md b/NEWS.md index 1bb41dcb..3b7d3f69 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# naomi 2.9.25 + +* Suppress warning raised from duckdb shutdown + # naomi 2.9.24 * Migrate to github actions diff --git a/R/outputs.R b/R/outputs.R index ce55d871..3e2ebdec 100644 --- a/R/outputs.R +++ b/R/outputs.R @@ -1355,7 +1355,7 @@ read_hintr_output <- function(path) { } read_duckdb <- function(path) { - con <- DBI::dbConnect(duckdb::duckdb(), dbdir = path, read_only = TRUE) + con <- DBI::dbConnect(duckdb::duckdb(dbdir = path, read_only = TRUE)) on.exit(DBI::dbDisconnect(con, shutdown = TRUE)) DBI::dbGetQuery(con, sprintf("SELECT * from %s", DUCKDB_OUTPUT_TABLE_NAME)) } diff --git a/R/run-model.R b/R/run-model.R index f785f37b..9939156f 100644 --- a/R/run-model.R +++ b/R/run-model.R @@ -149,9 +149,9 @@ hintr_save <- function(obj, file) { stop(paste("Trying to save invalid object as duckdb database.", "Only data frames can be saved as database.")) } - con <- DBI::dbConnect(duckdb::duckdb(), dbdir = file) + con <- DBI::dbConnect(duckdb::duckdb(dbdir = file)) + on.exit(DBI::dbDisconnect(con, shutdown = TRUE)) DBI::dbWriteTable(con, DUCKDB_OUTPUT_TABLE_NAME, obj) - DBI::dbDisconnect(con, shutdown = TRUE) } else { stop(sprintf("Cannot save as type '%s', must be 'qs' or 'duckdb'.", type)) } diff --git a/README.md b/README.md index 1a5610c7..19f6364c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ ## Naomi -![R CMD check](https://github.com/mrc-ide/naomi/actions/workflows/R-CMD-check.yml/badge.svg) +[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) +[![R-CMD-check](https://github.com/mrc-ide/naomi/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/mrc-ide/naomi/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/mrc-ide/naomi/branch/master/graph/badge.svg)](https://codecov.io/gh/mrc-ide/naomi?branch=master) Naomi model for subnational HIV estimates diff --git a/docker/Dockerfile b/docker/Dockerfile index 99299213..13feb016 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -10,10 +10,8 @@ ENV NAOMI_GIT_BRANCH $GIT_BRANCH ENV NAOMI_VERSION $NAOMI_VERSION RUN install_packages --repo=https://mrc-ide.r-universe.dev \ - mockr \ rvest \ - pkgbuild \ - testthat.buildkite + pkgbuild ## Model run will try to parallelise over as many threads as are available ## potentially slowing the application, manually limit threads to 1