From 4c217619e1f82ea43cd4bec2c1cf9f90937916cc Mon Sep 17 00:00:00 2001 From: mpadge Date: Tue, 2 Jun 2026 15:31:09 +0200 Subject: [PATCH 1/2] update pre-commit-config --- .pre-commit-config.yaml | 2 +- DESCRIPTION | 2 +- codemeta.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8e147a31..724aa193 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # R specific hooks: https://github.com/lorenzwalthert/precommit repos: - repo: https://github.com/lorenzwalthert/precommit - rev: v0.4.3.9021 + rev: v0.4.3.9025 hooks: - id: style-files args: [--style_pkg=spaceout, --style_fun=spaceout_style, --include_roxygen_examples=FALSE] diff --git a/DESCRIPTION b/DESCRIPTION index fd3af603..1bcaadf1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: dodgr Title: Distances on Directed Graphs -Version: 0.4.3.020 +Version: 0.4.3.021 Authors@R: c( person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre")), person("Andreas", "Petutschnig", role = "aut"), diff --git a/codemeta.json b/codemeta.json index 9678351d..eadda988 100644 --- a/codemeta.json +++ b/codemeta.json @@ -11,7 +11,7 @@ "codeRepository": "https://github.com/UrbanAnalyst/dodgr", "issueTracker": "https://github.com/UrbanAnalyst/dodgr/issues", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "0.4.3.020", + "version": "0.4.3.021", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", From bdcfdf116508424047341aa8ede30d1c0d8a7213 Mon Sep 17 00:00:00 2001 From: mpadge Date: Tue, 2 Jun 2026 15:35:23 +0200 Subject: [PATCH 2/2] require all namespaces quietly --- DESCRIPTION | 2 +- NEWS.md | 1 + R/compare-heaps.R | 4 ++-- R/graph-conversion.R | 10 +++++----- R/weight-streetnet.R | 2 +- R/weighting_profiles.R | 2 +- codemeta.json | 2 +- tests/testthat/test-cache.R | 2 +- tests/testthat/test-iso.R | 2 +- tests/testthat/test-sc.R | 2 +- 10 files changed, 15 insertions(+), 14 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1bcaadf1..88a00759 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: dodgr Title: Distances on Directed Graphs -Version: 0.4.3.021 +Version: 0.4.3.022 Authors@R: c( person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre")), person("Andreas", "Petutschnig", role = "aut"), diff --git a/NEWS.md b/NEWS.md index 8b9ef46c..c4ef1edb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,6 +6,7 @@ - Add `pairwise` parameter to `dodgr_times()`; thanks to @leoniedu (#314) - Fix bug with categorical distances that neglected edges through compound junctions (#305) - Fix bug in duplicating bi-directional edges in weighted sc-class graphs +- Finally add 'quietly = TRUE' to all `requireNamespace` calls. --- diff --git a/R/compare-heaps.R b/R/compare-heaps.R index e7658b72..62441a63 100644 --- a/R/compare-heaps.R +++ b/R/compare-heaps.R @@ -24,8 +24,8 @@ compare_heaps <- function (graph, nverts = 100, replications = 2) { - requireNamespace ("bench") - requireNamespace ("igraph") + requireNamespace ("bench", quietly = TRUE) + requireNamespace ("igraph", quietly = TRUE) if (is.numeric (nverts)) { graph <- dodgr_sample (graph, nverts = nverts) diff --git a/R/graph-conversion.R b/R/graph-conversion.R index 7ec717a9..d160dea5 100644 --- a/R/graph-conversion.R +++ b/R/graph-conversion.R @@ -30,7 +30,7 @@ dodgr_to_sf <- function (graph) { graph <- tbl_to_df (graph) attr (graph, "hash") <- get_hash (graph, contracted = FALSE, force = TRUE) - requireNamespace ("sf") + requireNamespace ("sf", quietly = TRUE) res <- dodgr_to_sfc (graph) sf::st_sf (res$dat, geometry = res$geometry, crs = 4326) } @@ -140,7 +140,7 @@ dodgr_to_sfc <- function (graph) { #' graphi <- dodgr_to_igraph (graph) dodgr_to_igraph <- function (graph, weight_column = "d") { - requireNamespace ("igraph") + requireNamespace ("igraph", quietly = TRUE) graph <- tbl_to_df (graph) if (!weight_column %in% names (graph)) { stop ("graph contains no column named '", weight_column, "'") @@ -191,7 +191,7 @@ dodgr_to_igraph <- function (graph, weight_column = "d") { #' identical (graph2, graph) # FALSE igraph_to_dodgr <- function (graph) { - requireNamespace ("igraph") + requireNamespace ("igraph", quietly = TRUE) ei <- igraph::edge_attr (graph) vi <- igraph::vertex_attr (graph) index <- grep ("^lon|^lat|lon$|lat$|^x|^y|x$|y$", names (ei)) @@ -257,8 +257,8 @@ convert_col <- function (x, n = 3) { #' grapht <- dodgr_to_tidygraph (graph) dodgr_to_tidygraph <- function (graph) { - requireNamespace ("igraph") - requireNamespace ("tidygraph") + requireNamespace ("igraph", quietly = TRUE) + requireNamespace ("tidygraph", quietly = TRUE) dodgr_to_igraph (graph) %>% tidygraph::as_tbl_graph () diff --git a/R/weight-streetnet.R b/R/weight-streetnet.R index 88014b85..b5299306 100644 --- a/R/weight-streetnet.R +++ b/R/weight-streetnet.R @@ -691,7 +691,7 @@ weight_streetnet.sc <- function (x, keep_cols = NULL, left_side = FALSE) { - requireNamespace ("dplyr") + requireNamespace ("dplyr", quietly = TRUE) check_sc (x) x$vertex <- x$vertex [which (!duplicated (x$vertex)), ] diff --git a/R/weighting_profiles.R b/R/weighting_profiles.R index 2e08ae30..2ff2eefc 100644 --- a/R/weighting_profiles.R +++ b/R/weighting_profiles.R @@ -15,7 +15,7 @@ #' @export write_dodgr_wt_profile <- function (file = NULL) { - requireNamespace ("jsonlite") + requireNamespace ("jsonlite", quietly = TRUE) if (is.null (file)) { stop ("file name must be given") diff --git a/codemeta.json b/codemeta.json index eadda988..1e93fe7e 100644 --- a/codemeta.json +++ b/codemeta.json @@ -11,7 +11,7 @@ "codeRepository": "https://github.com/UrbanAnalyst/dodgr", "issueTracker": "https://github.com/UrbanAnalyst/dodgr/issues", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "0.4.3.021", + "version": "0.4.3.022", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", diff --git a/tests/testthat/test-cache.R b/tests/testthat/test-cache.R index 46a048ef..77a80fe5 100644 --- a/tests/testthat/test-cache.R +++ b/tests/testthat/test-cache.R @@ -13,7 +13,7 @@ if (!test_all) { test_that ("cache on", { expect_silent (hsc <- sf_to_sc (hampi)) - requireNamespace ("dplyr") + requireNamespace ("dplyr", quietly = TRUE) expect_silent (graph <- weight_streetnet (hsc)) expect_message ( graph <- dodgr_components (graph), diff --git a/tests/testthat/test-iso.R b/tests/testthat/test-iso.R index 19014ac7..0e817c39 100644 --- a/tests/testthat/test-iso.R +++ b/tests/testthat/test-iso.R @@ -8,7 +8,7 @@ if (!test_all) { test_that ("isodists", { expect_silent (hsc <- sf_to_sc (hampi)) # This all exists just to test the next line: - requireNamespace ("dplyr") + requireNamespace ("dplyr", quietly = TRUE) net <- weight_streetnet (hsc, wt_profile = "bicycle" ) diff --git a/tests/testthat/test-sc.R b/tests/testthat/test-sc.R index 839e9750..b709720c 100644 --- a/tests/testthat/test-sc.R +++ b/tests/testthat/test-sc.R @@ -14,7 +14,7 @@ skip_if (!test_all) test_that ("SC", { expect_silent (hsc <- sf_to_sc (hampi)) # This all exists just to test the next line: - requireNamespace ("dplyr") + requireNamespace ("dplyr", quietly = TRUE) expect_silent (net_sc <- weight_streetnet (hsc)) expect_is (net_sc, "data.frame") expect_true (nrow (net_sc) > 0)