From 4ab4c2ca661baabcf06c77c8beaa856149b9d684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Tue, 24 Sep 2024 15:39:52 +0200 Subject: [PATCH] chore!: remove deprecated `neimode` parameter from `bfs` / `dfs`; originally planned for removal in 1.4.0 --- R/structural.properties.R | 10 ++-------- tests/testthat/_snaps/structural.properties.md | 8 ++++---- tests/testthat/test-structural.properties.R | 4 ++-- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/R/structural.properties.R b/R/structural.properties.R index d765c2fc22..68ec6cceec 100644 --- a/R/structural.properties.R +++ b/R/structural.properties.R @@ -2140,14 +2140,11 @@ bfs <- function( ensure_igraph(graph) if (lifecycle::is_present(neimode)) { - lifecycle::deprecate_warn( + lifecycle::deprecate_stop( "1.3.0", "bfs(neimode)", "bfs(mode)" ) - if (missing(mode)) { - mode <- neimode - } } if (length(root) == 1) { @@ -2315,14 +2312,11 @@ dfs <- function(graph, root, mode = c("out", "in", "all", "total"), rho = parent.frame(), neimode = deprecated()) { ensure_igraph(graph) if (lifecycle::is_present(neimode)) { - lifecycle::deprecate_warn( + lifecycle::deprecate_stop( "1.3.0", "dfs(neimode)", "dfs(mode)" ) - if (missing(mode)) { - mode <- neimode - } } root <- as_igraph_vs(graph, root) - 1 diff --git a/tests/testthat/_snaps/structural.properties.md b/tests/testthat/_snaps/structural.properties.md index d8f926aeba..55f0821624 100644 --- a/tests/testthat/_snaps/structural.properties.md +++ b/tests/testthat/_snaps/structural.properties.md @@ -3,8 +3,8 @@ Code d <- dfs(g, root = 2, unreachable = FALSE, neimode = "out") Condition - Warning: - The `neimode` argument of `dfs()` is deprecated as of igraph 1.3.0. + Error: + ! The `neimode` argument of `dfs()` was deprecated in igraph 1.3.0 and is now defunct. i Please use the `mode` argument instead. --- @@ -13,8 +13,8 @@ b <- bfs(g, root = 2, neimode = "out", unreachable = FALSE, order = TRUE, rank = TRUE, father = TRUE, pred = TRUE, succ = TRUE, dist = TRUE) Condition - Warning: - The `neimode` argument of `bfs()` is deprecated as of igraph 1.3.0. + Error: + ! The `neimode` argument of `bfs()` was deprecated in igraph 1.3.0 and is now defunct. i Please use the `mode` argument instead. # bfs() works diff --git a/tests/testthat/test-structural.properties.R b/tests/testthat/test-structural.properties.R index 94703a2691..99ce76f3ed 100644 --- a/tests/testthat/test-structural.properties.R +++ b/tests/testthat/test-structural.properties.R @@ -15,7 +15,7 @@ test_that("dfs() does not pad order", { test_that("bfs() deprecated argument", { g <- make_star(3) - expect_snapshot({ + expect_snapshot(error = TRUE, { d <- dfs( g, root = 2, @@ -199,7 +199,7 @@ test_that("bfs() works", { test_that("bfs() deprecated argument", { g <- graph_from_literal(a - +b - +c, z - +a, d) - expect_snapshot({ + expect_snapshot(error = TRUE, { b <- bfs( g, root = 2,