diff --git a/.Rbuildignore b/.Rbuildignore index f6cd805ee96..b79b546771e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -71,3 +71,4 @@ ^BRANCHES\.md$ ^scripts$ ^\.claude$ +^lifecycle-TODO\.md$ diff --git a/R/adjacency.R b/R/adjacency.R index 65b4eb21411..f1424f964e4 100644 --- a/R/adjacency.R +++ b/R/adjacency.R @@ -17,7 +17,7 @@ graph.adjacency <- function( add.rownames = NA ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "graph.adjacency()", "graph_from_adjacency_matrix()" @@ -293,7 +293,7 @@ graph_from_adjacency_matrix <- function( ensure_no_na(adjmatrix, "adjacency matrix", mode) if (!is.matrix(adjmatrix) && !inherits(adjmatrix, "Matrix")) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", "graph_from_adjacency_matrix(adjmatrix = 'must be a matrix')" ) @@ -302,7 +302,7 @@ graph_from_adjacency_matrix <- function( if (mode == "undirected") { if (!is_symmetric(adjmatrix)) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", "graph_from_adjacency_matrix(adjmatrix = 'must be symmetric with mode = \"undirected\"')", details = 'Use mode = "max" to achieve the original behavior.' diff --git a/R/as_phylo.R b/R/as_phylo.R index c33615d8db4..03e8b21e0a4 100644 --- a/R/as_phylo.R +++ b/R/as_phylo.R @@ -10,7 +10,7 @@ #' @inheritParams ape::as.phylo #' @keywords internal as_phylo <- function(x, ...) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.5.0", "ape::as.phylo()" ) diff --git a/R/assortativity.R b/R/assortativity.R index 5a1b7d2055a..074fa421b35 100644 --- a/R/assortativity.R +++ b/R/assortativity.R @@ -15,7 +15,7 @@ assortativity.nominal <- function( normalized = TRUE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "assortativity.nominal()", "assortativity_nominal()" @@ -40,7 +40,7 @@ assortativity.nominal <- function( #' @export assortativity.degree <- function(graph, directed = TRUE) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "assortativity.degree()", "assortativity_degree()" @@ -171,7 +171,7 @@ assortativity <- function( types2 = NULL ) { if (...length() > 0) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", "assortativity(... =)", details = "Arguments `values` and `values.in` must be named." @@ -193,7 +193,7 @@ assortativity <- function( } if (missing(values)) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", "assortativity(types1 =)", "assortativity(values =)" @@ -202,7 +202,7 @@ assortativity <- function( } if (!is.null(types2)) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", "assortativity(types2 =)", "assortativity(values.in =)" diff --git a/R/attributes.R b/R/attributes.R index 87af8d6b304..1a34d29fc8e 100644 --- a/R/attributes.R +++ b/R/attributes.R @@ -10,7 +10,7 @@ #' @export set.vertex.attribute <- function(graph, name, index = V(graph), value) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "set.vertex.attribute()", "set_vertex_attr()" @@ -30,7 +30,7 @@ set.vertex.attribute <- function(graph, name, index = V(graph), value) { #' @export set.graph.attribute <- function(graph, name, value) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "set.graph.attribute()", "set_graph_attr()" @@ -50,7 +50,7 @@ set.graph.attribute <- function(graph, name, value) { #' @export set.edge.attribute <- function(graph, name, index = E(graph), value) { # nocov start - lifecycle::deprecate_soft("2.0.0", "set.edge.attribute()", "set_edge_attr()") + lifecycle::deprecate_warn("2.0.0", "set.edge.attribute()", "set_edge_attr()") set_edge_attr(graph = graph, name = name, index = index, value = value) } # nocov end @@ -66,7 +66,7 @@ set.edge.attribute <- function(graph, name, index = E(graph), value) { #' @export remove.vertex.attribute <- function(graph, name) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "remove.vertex.attribute()", "delete_vertex_attr()" @@ -86,7 +86,7 @@ remove.vertex.attribute <- function(graph, name) { #' @export remove.graph.attribute <- function(graph, name) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "remove.graph.attribute()", "delete_graph_attr()" @@ -106,7 +106,7 @@ remove.graph.attribute <- function(graph, name) { #' @export remove.edge.attribute <- function(graph, name) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "remove.edge.attribute()", "delete_edge_attr()" @@ -126,7 +126,7 @@ remove.edge.attribute <- function(graph, name) { #' @export list.vertex.attributes <- function(graph) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "list.vertex.attributes()", "vertex_attr_names()" @@ -146,7 +146,7 @@ list.vertex.attributes <- function(graph) { #' @export list.graph.attributes <- function(graph) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "list.graph.attributes()", "graph_attr_names()" @@ -166,7 +166,7 @@ list.graph.attributes <- function(graph) { #' @export list.edge.attributes <- function(graph) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "list.edge.attributes()", "edge_attr_names()" @@ -186,7 +186,7 @@ list.edge.attributes <- function(graph) { #' @export is.weighted <- function(graph) { # nocov start - lifecycle::deprecate_soft("2.0.0", "is.weighted()", "is_weighted()") + lifecycle::deprecate_warn("2.0.0", "is.weighted()", "is_weighted()") is_weighted(graph = graph) } # nocov end @@ -202,7 +202,7 @@ is.weighted <- function(graph) { #' @export is.named <- function(graph) { # nocov start - lifecycle::deprecate_soft("2.0.0", "is.named()", "is_named()") + lifecycle::deprecate_warn("2.0.0", "is.named()", "is_named()") is_named(graph = graph) } # nocov end @@ -218,7 +218,7 @@ is.named <- function(graph) { #' @export is.bipartite <- function(graph) { # nocov start - lifecycle::deprecate_soft("2.0.0", "is.bipartite()", "is_bipartite()") + lifecycle::deprecate_warn("2.0.0", "is.bipartite()", "is_bipartite()") is_bipartite(graph = graph) } # nocov end @@ -234,7 +234,7 @@ is.bipartite <- function(graph) { #' @export get.vertex.attribute <- function(graph, name, index = V(graph)) { # nocov start - lifecycle::deprecate_soft("2.0.0", "get.vertex.attribute()", "vertex_attr()") + lifecycle::deprecate_warn("2.0.0", "get.vertex.attribute()", "vertex_attr()") vertex_attr(graph = graph, name = name, index = index) } # nocov end @@ -250,7 +250,7 @@ get.vertex.attribute <- function(graph, name, index = V(graph)) { #' @export get.graph.attribute <- function(graph, name) { # nocov start - lifecycle::deprecate_soft("2.0.0", "get.graph.attribute()", "graph_attr()") + lifecycle::deprecate_warn("2.0.0", "get.graph.attribute()", "graph_attr()") graph_attr(graph = graph, name = name) } # nocov end @@ -266,7 +266,7 @@ get.graph.attribute <- function(graph, name) { #' @export get.edge.attribute <- function(graph, name, index = E(graph)) { # nocov start - lifecycle::deprecate_soft("2.0.0", "get.edge.attribute()", "edge_attr()") + lifecycle::deprecate_warn("2.0.0", "get.edge.attribute()", "edge_attr()") edge_attr(graph = graph, name = name, index = index) } # nocov end # IGraph R package diff --git a/R/basic.R b/R/basic.R index 47b00f7e071..4769854df36 100644 --- a/R/basic.R +++ b/R/basic.R @@ -10,7 +10,7 @@ #' @export is.igraph <- function(graph) { # nocov start - lifecycle::deprecate_soft("2.0.0", "is.igraph()", "is_igraph()") + lifecycle::deprecate_warn("2.0.0", "is.igraph()", "is_igraph()") is_igraph(graph = graph) } # nocov end # IGraph R package @@ -56,19 +56,6 @@ is_igraph <- function(graph) { TRUE } -#' Incident vertices of some graph edges -#' @description -#' `r lifecycle::badge("deprecated")` -#' -#' Use [ends()]. -#' @inheritParams ends -#' @export -#' @keywords internal -get.edge <- function(graph, id) { - lifecycle::deprecate_stop("2.1.0", "get.edge()", "ends()") -} - - #' Head of the edge(s) in a graph #' #' For undirected graphs, head and tail is not defined. In this case diff --git a/R/bipartite.R b/R/bipartite.R index 5e640313588..24f2d63ebda 100644 --- a/R/bipartite.R +++ b/R/bipartite.R @@ -10,7 +10,7 @@ #' @export bipartite.projection.size <- function(graph, types = NULL) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "bipartite.projection.size()", "bipartite_projection_size()" @@ -37,7 +37,7 @@ bipartite.projection <- function( remove.type = TRUE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "bipartite.projection()", "bipartite_projection()" @@ -64,7 +64,7 @@ bipartite.projection <- function( #' @export bipartite.mapping <- function(graph) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "bipartite.mapping()", "bipartite_mapping()" diff --git a/R/centrality.R b/R/centrality.R index f239487876f..0cec52a6a44 100644 --- a/R/centrality.R +++ b/R/centrality.R @@ -10,7 +10,7 @@ #' @export subgraph.centrality <- function(graph, diag = FALSE) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "subgraph.centrality()", "subgraph_centrality()" @@ -39,7 +39,7 @@ page.rank <- function( options = NULL ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "page.rank()", "page_rank()") + lifecycle::deprecate_warn("2.0.0", "page.rank()", "page_rank()") page_rank( graph = graph, algo = algo, @@ -69,7 +69,7 @@ hub.score <- function( options = arpack_defaults() ) { # nocov start - lifecycle::deprecate_warn("2.0.0", "hub.score()", "hits_scores()") + lifecycle::deprecate_stop("2.0.0", "hub.score()", "hits_scores()") hub_score(graph = graph, scale = scale, weights = weights, options = options) } # nocov end @@ -90,7 +90,7 @@ authority.score <- function( options = arpack_defaults() ) { # nocov start - lifecycle::deprecate_warn("2.0.0", "authority.score()", "hits_scores()") + lifecycle::deprecate_stop("2.0.0", "authority.score()", "hits_scores()") authority_score( graph = graph, scale = scale, @@ -117,7 +117,7 @@ graph.strength <- function( weights = NULL ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "graph.strength()", "strength()") + lifecycle::deprecate_warn("2.0.0", "graph.strength()", "strength()") strength( graph = graph, vids = vids, @@ -151,7 +151,7 @@ graph.eigen <- function( options = arpack_defaults() ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "graph.eigen()", "spectrum()") + lifecycle::deprecate_warn("2.0.0", "graph.eigen()", "spectrum()") spectrum( graph = graph, algorithm = algorithm, @@ -172,7 +172,7 @@ graph.eigen <- function( #' @export graph.diversity <- function(graph, weights = NULL, vids = V(graph)) { # nocov start - lifecycle::deprecate_soft("2.0.0", "graph.diversity()", "diversity()") + lifecycle::deprecate_warn("2.0.0", "graph.diversity()", "diversity()") diversity(graph = graph, weights = weights, vids = vids) } # nocov end @@ -194,7 +194,7 @@ evcent <- function( options = arpack_defaults() ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "evcent()", "eigen_centrality()") + lifecycle::deprecate_warn("2.0.0", "evcent()", "eigen_centrality()") eigen_centrality( graph = graph, directed = directed, @@ -222,7 +222,7 @@ edge.betweenness <- function( cutoff = -1 ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "edge.betweenness()", "edge_betweenness()") + lifecycle::deprecate_warn("2.0.0", "edge.betweenness()", "edge_betweenness()") edge_betweenness( graph = graph, e = e, @@ -252,7 +252,7 @@ bonpow <- function( sparse = TRUE ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "bonpow()", "power_centrality()") + lifecycle::deprecate_warn("2.0.0", "bonpow()", "power_centrality()") power_centrality( graph = graph, nodes = nodes, @@ -285,7 +285,7 @@ alpha.centrality <- function( sparse = TRUE ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "alpha.centrality()", "alpha_centrality()") + lifecycle::deprecate_warn("2.0.0", "alpha.centrality()", "alpha_centrality()") alpha_centrality( graph = graph, nodes = nodes, @@ -336,7 +336,7 @@ estimate_betweenness <- function( cutoff, weights = NULL ) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", "estimate_betweenness()", "betweenness()", @@ -498,7 +498,7 @@ estimate_edge_betweenness <- function( cutoff, weights = NULL ) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", "estimate_edge_betweenness()", "edge_betweenness()", @@ -611,7 +611,7 @@ estimate_closeness <- function( weights = NULL, normalized = FALSE ) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", "estimate_closeness()", "closeness()", @@ -961,7 +961,7 @@ arpack <- function( complex = !sym ) { if (is.function(options)) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", "arpack(options = 'must be a list')", details = c( @@ -1170,7 +1170,7 @@ spectrum <- function( options = arpack_defaults() ) { if (is.function(options)) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", "spectrum(options = 'must be a list')", details = c( @@ -1299,7 +1299,7 @@ eigen_centrality <- function( options = arpack_defaults() ) { if (is.function(options)) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", "eigen_centrality(options = 'must be a list')", details = c( @@ -1311,13 +1311,13 @@ eigen_centrality <- function( if (lifecycle::is_present(scale)) { if (isTRUE(scale)) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.1.1", "eigen_centrality(scale)", details = "eigen_centrality() will always behave as if scale=TRUE were used." ) } else { - lifecycle::deprecate_warn( + lifecycle::deprecate_stop( "2.1.1", "eigen_centrality(scale = 'always as if TRUE')", details = "Normalization is always performed" @@ -1522,9 +1522,9 @@ authority_score <- function( weights = NULL, options = arpack_defaults() ) { - lifecycle::deprecate_soft("2.1.0", "authority_score()", "hits_scores()") + lifecycle::deprecate_warn("2.1.0", "authority_score()", "hits_scores()") if (is.function(options)) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", I("arpack_defaults"), "arpack_defaults()", @@ -1567,9 +1567,9 @@ hub_score <- function( weights = NULL, options = arpack_defaults() ) { - lifecycle::deprecate_soft("2.0.3", "hub_score()", "hits_scores()") + lifecycle::deprecate_warn("2.0.3", "hub_score()", "hits_scores()") if (is.function(options)) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", I("arpack_defaults"), "arpack_defaults()", diff --git a/R/centralization.R b/R/centralization.R index bd6dfb570ef..e0655d7f295 100644 --- a/R/centralization.R +++ b/R/centralization.R @@ -10,7 +10,7 @@ #' @export centralize.scores <- function(scores, theoretical.max = 0, normalized = TRUE) { # nocov start - lifecycle::deprecate_soft("2.0.0", "centralize.scores()", "centralize()") + lifecycle::deprecate_warn("2.0.0", "centralize.scores()", "centralize()") centralize( scores = scores, theoretical.max = theoretical.max, @@ -35,7 +35,7 @@ centralization.evcent.tmax <- function( scale = TRUE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "centralization.evcent.tmax()", "centr_eigen_tmax()" @@ -66,7 +66,7 @@ centralization.evcent <- function( normalized = TRUE ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "centralization.evcent()", "centr_eigen()") + lifecycle::deprecate_warn("2.0.0", "centralization.evcent()", "centr_eigen()") centr_eigen( graph = graph, directed = directed, @@ -93,7 +93,7 @@ centralization.degree.tmax <- function( loops = FALSE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "centralization.degree.tmax()", "centr_degree_tmax()" @@ -118,7 +118,7 @@ centralization.degree <- function( normalized = TRUE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "centralization.degree()", "centr_degree()" @@ -147,7 +147,7 @@ centralization.closeness.tmax <- function( mode = c("out", "in", "all", "total") ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "centralization.closeness.tmax()", "centr_clo_tmax()" @@ -171,7 +171,7 @@ centralization.closeness <- function( normalized = TRUE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "centralization.closeness()", "centr_clo()" @@ -195,7 +195,7 @@ centralization.betweenness.tmax <- function( directed = TRUE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "centralization.betweenness.tmax()", "centr_betw_tmax()" @@ -219,7 +219,7 @@ centralization.betweenness <- function( normalized = TRUE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "centralization.betweenness()", "centr_betw()" @@ -404,7 +404,7 @@ centr_degree_tmax <- function( loops ) { if (!lifecycle::is_present(loops)) { - lifecycle::deprecate_warn( + lifecycle::deprecate_stop( when = "2.0.0", what = "centr_degree_tmax(loops = 'must be explicit')", details = "The default value (currently `FALSE`) will be dropped in the next release. Add an explicit value for the `loops` argument." @@ -658,7 +658,7 @@ centr_eigen <- function( normalized = TRUE ) { if (lifecycle::is_present(scale)) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.2.0", "centr_eigen(scale = )", details = "The function always behaves as if `scale = TRUE`. @@ -708,7 +708,7 @@ centr_eigen_tmax <- function( scale = deprecated() ) { if (lifecycle::is_present(scale)) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.2.0", "centr_eigen_tmax(scale = )", details = "The function always behaves as if `scale = TRUE`. diff --git a/R/cliques.R b/R/cliques.R index 4bd6018334c..9d3ce765399 100644 --- a/R/cliques.R +++ b/R/cliques.R @@ -10,7 +10,7 @@ #' @export maximal.independent.vertex.sets <- function(graph) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "maximal.independent.vertex.sets()", "max_ivs()" @@ -35,7 +35,7 @@ maximal.cliques.count <- function( subset = NULL ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "maximal.cliques.count()", "count_max_cliques()" @@ -61,7 +61,7 @@ maximal.cliques <- function( file = NULL ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "maximal.cliques()", "max_cliques()") + lifecycle::deprecate_warn("2.0.0", "maximal.cliques()", "max_cliques()") max_cliques(graph = graph, min = min, max = max, subset = subset, file = file) } # nocov end @@ -77,7 +77,7 @@ maximal.cliques <- function( #' @export largest.independent.vertex.sets <- function(graph) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "largest.independent.vertex.sets()", "largest_ivs()" @@ -97,7 +97,7 @@ largest.independent.vertex.sets <- function(graph) { #' @export largest.cliques <- function(graph) { # nocov start - lifecycle::deprecate_soft("2.0.0", "largest.cliques()", "largest_cliques()") + lifecycle::deprecate_warn("2.0.0", "largest.cliques()", "largest_cliques()") largest_cliques(graph = graph) } # nocov end @@ -113,7 +113,7 @@ largest.cliques <- function(graph) { #' @export independent.vertex.sets <- function(graph, min = NULL, max = NULL) { # nocov start - lifecycle::deprecate_soft("2.0.0", "independent.vertex.sets()", "ivs()") + lifecycle::deprecate_warn("2.0.0", "independent.vertex.sets()", "ivs()") ivs(graph = graph, min = min, max = max) } # nocov end @@ -129,7 +129,7 @@ independent.vertex.sets <- function(graph, min = NULL, max = NULL) { #' @export independence.number <- function(graph) { # nocov start - lifecycle::deprecate_soft("2.0.0", "independence.number()", "ivs_size()") + lifecycle::deprecate_warn("2.0.0", "independence.number()", "ivs_size()") ivs_size(graph = graph) } # nocov end @@ -145,7 +145,7 @@ independence.number <- function(graph) { #' @export clique.number <- function(graph) { # nocov start - lifecycle::deprecate_soft("2.0.0", "clique.number()", "clique_num()") + lifecycle::deprecate_warn("2.0.0", "clique.number()", "clique_num()") clique_num(graph = graph) } # nocov end # IGraph R package @@ -615,7 +615,7 @@ max_ivs <- function(graph) { #' @inheritParams max_ivs #' @keywords internal maximal_ivs <- function(graph) { - lifecycle::deprecate_soft("2.1.0", "maximal_ivs()", "max_ivs()") + lifecycle::deprecate_warn("2.1.0", "maximal_ivs()", "max_ivs()") max_ivs(graph) } diff --git a/R/cohesive.blocks.R b/R/cohesive.blocks.R index 35844360284..202ed43dad8 100644 --- a/R/cohesive.blocks.R +++ b/R/cohesive.blocks.R @@ -10,7 +10,7 @@ #' @export exportPajek <- function(blocks, graph, file, project.file = TRUE) { # nocov start - lifecycle::deprecate_soft("2.0.0", "exportPajek()", "export_pajek()") + lifecycle::deprecate_warn("2.0.0", "exportPajek()", "export_pajek()") export_pajek( blocks = blocks, graph = graph, @@ -35,7 +35,7 @@ plotHierarchy <- function( ... ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "plotHierarchy()", "plot_hierarchy()") + lifecycle::deprecate_warn("2.0.0", "plotHierarchy()", "plot_hierarchy()") plot_hierarchy(blocks = blocks, layout = layout, ...) } # nocov end @@ -51,7 +51,7 @@ plotHierarchy <- function( #' @export maxcohesion <- function(blocks) { # nocov start - lifecycle::deprecate_soft("2.0.0", "maxcohesion()", "max_cohesion()") + lifecycle::deprecate_warn("2.0.0", "maxcohesion()", "max_cohesion()") max_cohesion(blocks = blocks) } # nocov end @@ -68,7 +68,7 @@ maxcohesion <- function(blocks) { #' @export graph.cohesion <- function(x, ...) { # nocov start - lifecycle::deprecate_soft("2.0.0", "graph.cohesion()", "cohesion()") + lifecycle::deprecate_warn("2.0.0", "graph.cohesion()", "cohesion()") cohesion(x = x, ...) } # nocov end @@ -84,7 +84,7 @@ graph.cohesion <- function(x, ...) { #' @export cohesive.blocks <- function(graph, labels = TRUE) { # nocov start - lifecycle::deprecate_soft("2.0.0", "cohesive.blocks()", "cohesive_blocks()") + lifecycle::deprecate_warn("2.0.0", "cohesive.blocks()", "cohesive_blocks()") cohesive_blocks(graph = graph, labels = labels) } # nocov end @@ -100,7 +100,7 @@ cohesive.blocks <- function(graph, labels = TRUE) { #' @export blockGraphs <- function(blocks, graph) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "blockGraphs()", "graphs_from_cohesive_blocks()" diff --git a/R/community.R b/R/community.R index 352f534ba11..0d9b8cf3781 100644 --- a/R/community.R +++ b/R/community.R @@ -16,7 +16,7 @@ create.communities <- function( modularity = TRUE ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "create.communities()", "make_clusters()") + lifecycle::deprecate_warn("2.0.0", "create.communities()", "make_clusters()") make_clusters( graph = graph, membership = membership, @@ -45,7 +45,7 @@ walktrap.community <- function( membership = TRUE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "walktrap.community()", "cluster_walktrap()" @@ -85,7 +85,7 @@ spinglass.community <- function( gamma.minus = 1.0 ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "spinglass.community()", "cluster_spinglass()" @@ -118,7 +118,7 @@ spinglass.community <- function( #' @export showtrace <- function(communities) { # nocov start - lifecycle::deprecate_soft("2.0.0", "showtrace()", "show_trace()") + lifecycle::deprecate_warn("2.0.0", "showtrace()", "show_trace()") show_trace(communities = communities) } # nocov end @@ -134,7 +134,7 @@ showtrace <- function(communities) { #' @export optimal.community <- function(graph, weights = NULL) { # nocov start - lifecycle::deprecate_soft("2.0.0", "optimal.community()", "cluster_optimal()") + lifecycle::deprecate_warn("2.0.0", "optimal.community()", "cluster_optimal()") cluster_optimal(graph = graph, weights = weights) } # nocov end @@ -150,7 +150,7 @@ optimal.community <- function(graph, weights = NULL) { #' @export multilevel.community <- function(graph, weights = NULL, resolution = 1) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "multilevel.community()", "cluster_louvain()" @@ -176,7 +176,7 @@ mod.matrix <- function( directed = TRUE ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "mod.matrix()", "modularity_matrix()") + lifecycle::deprecate_warn("2.0.0", "mod.matrix()", "modularity_matrix()") modularity_matrix( graph = graph, membership = membership, @@ -207,7 +207,7 @@ leading.eigenvector.community <- function( env = parent.frame() ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "leading.eigenvector.community()", "cluster_leading_eigen()" @@ -243,7 +243,7 @@ label.propagation.community <- function( fixed = NULL ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "label.propagation.community()", "cluster_label_prop()" @@ -270,7 +270,7 @@ label.propagation.community <- function( #' @export is.hierarchical <- function(communities) { # nocov start - lifecycle::deprecate_soft("2.0.0", "is.hierarchical()", "is_hierarchical()") + lifecycle::deprecate_warn("2.0.0", "is.hierarchical()", "is_hierarchical()") is_hierarchical(communities = communities) } # nocov end @@ -292,7 +292,7 @@ infomap.community <- function( modularity = TRUE ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "infomap.community()", "cluster_infomap()") + lifecycle::deprecate_warn("2.0.0", "infomap.community()", "cluster_infomap()") cluster_infomap( graph = graph, e.weights = e.weights, @@ -320,7 +320,7 @@ fastgreedy.community <- function( weights = NULL ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "fastgreedy.community()", "cluster_fast_greedy()" @@ -355,7 +355,7 @@ edge.betweenness.community <- function( membership = TRUE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "edge.betweenness.community()", "cluster_edge_betweenness()" @@ -384,7 +384,7 @@ edge.betweenness.community <- function( #' @export dendPlot <- function(x, mode = igraph_opt("dend.plot.type"), ...) { # nocov start - lifecycle::deprecate_soft("2.0.0", "dendPlot()", "plot_dendrogram()") + lifecycle::deprecate_warn("2.0.0", "dendPlot()", "plot_dendrogram()") plot_dendrogram(x = x, mode = mode, ...) } # nocov end @@ -400,7 +400,7 @@ dendPlot <- function(x, mode = igraph_opt("dend.plot.type"), ...) { #' @export cutat <- function(communities, no, steps) { # nocov start - lifecycle::deprecate_soft("2.0.0", "cutat()", "cut_at()") + lifecycle::deprecate_warn("2.0.0", "cutat()", "cut_at()") cut_at(communities = communities, no = no, steps = steps) } # nocov end @@ -420,7 +420,7 @@ contract.vertices <- function( vertex.attr.comb = igraph_opt("vertex.attr.comb") ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "contract.vertices()", "contract()") + lifecycle::deprecate_warn("2.0.0", "contract.vertices()", "contract()") contract( graph = graph, mapping = mapping, @@ -440,7 +440,7 @@ contract.vertices <- function( #' @export code.length <- function(communities) { # nocov start - lifecycle::deprecate_soft("2.0.0", "code.length()", "code_len()") + lifecycle::deprecate_warn("2.0.0", "code.length()", "code_len()") code_len(communities = communities) } # nocov end # IGraph R package @@ -951,7 +951,7 @@ modularity_matrix <- function( ensure_igraph(graph) if (!missing(membership)) { - lifecycle::deprecate_warn( + lifecycle::deprecate_stop( "2.1.0", "modularity_matrix(membership = 'is no longer used')" ) @@ -1636,7 +1636,7 @@ cluster_leiden <- function( check_dots_empty() if (lifecycle::is_present(resolution_parameter)) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.1.0", "cluster_leiden(resolution_parameter)", "cluster_leiden(resolution)" @@ -2229,7 +2229,7 @@ cluster_leading_eigen <- function( env = parent.frame() ) { if (is.function(options)) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", "cluster_leading_eigen(options = 'must be a list')", details = c( @@ -2358,7 +2358,7 @@ cluster_label_prop <- function( fixed = NULL ) { if (...length() > 0) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", "cluster_label_prop(... = )", details = "Arguments `initial` and `fixed` must be named." diff --git a/R/components.R b/R/components.R index fab025773b2..1c0ab7b0a12 100644 --- a/R/components.R +++ b/R/components.R @@ -10,7 +10,7 @@ #' @export no.clusters <- function(graph, mode = c("weak", "strong")) { # nocov start - lifecycle::deprecate_soft("2.0.0", "no.clusters()", "count_components()") + lifecycle::deprecate_warn("2.0.0", "no.clusters()", "count_components()") count_components(graph = graph, mode = mode) } # nocov end @@ -31,7 +31,7 @@ decompose.graph <- function( min.vertices = 0 ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "decompose.graph()", "decompose()") + lifecycle::deprecate_warn("2.0.0", "decompose.graph()", "decompose()") decompose( graph = graph, mode = mode, @@ -57,7 +57,7 @@ cluster.distribution <- function( ... ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "cluster.distribution()", "component_distribution()" @@ -82,7 +82,7 @@ cluster.distribution <- function( #' @export biconnected.components <- function(graph) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "biconnected.components()", "biconnected_components()" @@ -102,7 +102,7 @@ biconnected.components <- function(graph) { #' @export articulation.points <- function(graph) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "articulation.points()", "articulation_points()" diff --git a/R/console.R b/R/console.R index 71defc045a7..ff898e1bfe0 100644 --- a/R/console.R +++ b/R/console.R @@ -11,7 +11,7 @@ #' @export igraph.console <- function() { # nocov start - lifecycle::deprecate_soft("2.0.0", "igraph.console()", "console()") + lifecycle::deprecate_warn("2.0.0", "igraph.console()", "console()") console() } # nocov end diff --git a/R/conversion.R b/R/conversion.R index 230cd369bd1..0634fb46949 100644 --- a/R/conversion.R +++ b/R/conversion.R @@ -10,7 +10,7 @@ #' @export igraph.to.graphNEL <- function(graph) { # nocov start - lifecycle::deprecate_soft("2.0.0", "igraph.to.graphNEL()", "as_graphnel()") + lifecycle::deprecate_warn("2.0.0", "igraph.to.graphNEL()", "as_graphnel()") as_graphnel(graph = graph) } # nocov end @@ -31,7 +31,7 @@ igraph.from.graphNEL <- function( unlist.attrs = TRUE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "igraph.from.graphNEL()", "graph_from_graphnel()" @@ -60,7 +60,7 @@ graph.adjlist <- function( duplicate = TRUE ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "graph.adjlist()", "graph_from_adj_list()") + lifecycle::deprecate_warn("2.0.0", "graph.adjlist()", "graph_from_adj_list()") graph_from_adj_list(adjlist = adjlist, mode = mode, duplicate = duplicate) } # nocov end @@ -82,7 +82,7 @@ get.incidence <- function( sparse = FALSE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "get.incidence()", "as_biadjacency_matrix()" @@ -108,7 +108,7 @@ get.incidence <- function( #' @export get.edgelist <- function(graph, names = TRUE) { # nocov start - lifecycle::deprecate_soft("2.0.0", "get.edgelist()", "as_edgelist()") + lifecycle::deprecate_warn("2.0.0", "get.edgelist()", "as_edgelist()") as_edgelist(graph = graph, names = names) } # nocov end @@ -124,7 +124,7 @@ get.edgelist <- function(graph, names = TRUE) { #' @export get.data.frame <- function(x, what = c("edges", "vertices", "both")) { # nocov start - lifecycle::deprecate_soft("2.0.0", "get.data.frame()", "as_data_frame()") + lifecycle::deprecate_warn("2.0.0", "get.data.frame()", "as_data_frame()") as_data_frame(x = x, what = what) } # nocov end @@ -147,7 +147,7 @@ get.adjacency <- function( sparse = igraph_opt("sparsematrices") ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "get.adjacency()", "as_adjacency_matrix()") + lifecycle::deprecate_warn("2.0.0", "get.adjacency()", "as_adjacency_matrix()") as_adjacency_matrix( graph = graph, type = type, @@ -175,7 +175,7 @@ get.adjlist <- function( multiple = TRUE ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "get.adjlist()", "as_adj_list()") + lifecycle::deprecate_warn("2.0.0", "get.adjlist()", "as_adj_list()") as_adj_list(graph = graph, mode = mode, loops = loops, multiple = multiple) } # nocov end @@ -195,7 +195,7 @@ get.adjedgelist <- function( loops = c("twice", "once", "ignore") ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "get.adjedgelist()", "as_adj_edge_list()") + lifecycle::deprecate_warn("2.0.0", "get.adjedgelist()", "as_adj_edge_list()") as_adj_edge_list(graph = graph, mode = mode, loops = loops) } # nocov end # IGraph R package @@ -232,7 +232,7 @@ get.adjacency.dense <- function( if (is.logical(loops)) { loops <- ifelse(loops, "once", "ignore") - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.1.0", "get.adjacency.dense(loops = 'must be a character')", details = sprintf( @@ -412,7 +412,7 @@ as_adj <- function( names = TRUE, sparse = igraph_opt("sparsematrices") ) { - lifecycle::deprecate_soft("2.1.0", "as_adj()", "as_adjacency_matrix()") + lifecycle::deprecate_warn("2.1.0", "as_adj()", "as_adjacency_matrix()") as_adjacency_matrix( graph = graph, @@ -1129,7 +1129,7 @@ as_biadjacency_matrix <- function( #' @export as_incidence_matrix <- function(...) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", "as_incidence_matrix()", "as_biadjacency_matrix()" @@ -1367,7 +1367,7 @@ as.directed <- function( graph, mode = c("mutual", "arbitrary", "random", "acyclic") ) { - lifecycle::deprecate_soft("2.1.0", "as.directed()", "as_directed()") + lifecycle::deprecate_warn("2.1.0", "as.directed()", "as_directed()") as_directed(graph, mode = mode) } @@ -1386,7 +1386,7 @@ as.undirected <- function( mode = c("collapse", "each", "mutual"), edge.attr.comb = igraph_opt("edge.attr.comb") ) { - lifecycle::deprecate_soft("2.1.0", "as.undirected()", "as_undirected()") + lifecycle::deprecate_warn("2.1.0", "as.undirected()", "as_undirected()") as_undirected(graph = graph, mode = mode, edge.attr.comb = edge.attr.comb) } @@ -1402,7 +1402,7 @@ as.undirected <- function( #' @export graph.edgelist <- function(el, directed = TRUE) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "graph.edgelist()", "graph_from_edgelist()" @@ -1422,7 +1422,7 @@ graph.edgelist <- function(el, directed = TRUE) { #' @export graph.data.frame <- function(d, directed = TRUE, vertices = NULL) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "graph.data.frame()", "graph_from_data_frame()" diff --git a/R/decomposition.R b/R/decomposition.R index 8c8e92b570c..47df101955e 100644 --- a/R/decomposition.R +++ b/R/decomposition.R @@ -16,7 +16,7 @@ is.chordal <- function( newgraph = FALSE ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "is.chordal()", "is_chordal()") + lifecycle::deprecate_warn("2.0.0", "is.chordal()", "is_chordal()") is_chordal( graph = graph, alpha = alpha, diff --git a/R/degseq.R b/R/degseq.R index 76a4401822d..918239d17dd 100644 --- a/R/degseq.R +++ b/R/degseq.R @@ -14,7 +14,7 @@ is.graphical.degree.sequence <- function( allowed.edge.types = c("simple", "loops", "multi", "all") ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "is.graphical.degree.sequence()", "is_graphical()" @@ -38,7 +38,7 @@ is.graphical.degree.sequence <- function( #' @export is.degree.sequence <- function(out.deg, in.deg = NULL) { # nocov start - lifecycle::deprecate_soft("2.0.0", "is.degree.sequence()", "is_degseq()") + lifecycle::deprecate_warn("2.0.0", "is.degree.sequence()", "is_degseq()") is_degseq(out.deg = out.deg, in.deg = in.deg) } # nocov end diff --git a/R/fit.R b/R/fit.R index e0849b32a4c..4993d32bc4e 100644 --- a/R/fit.R +++ b/R/fit.R @@ -17,7 +17,7 @@ power.law.fit <- function( ... ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "power.law.fit()", "fit_power_law()") + lifecycle::deprecate_warn("2.0.0", "power.law.fit()", "fit_power_law()") fit_power_law( x = x, xmin = xmin, diff --git a/R/flow.R b/R/flow.R index 0609fce12c3..43c3f0bf35c 100644 --- a/R/flow.R +++ b/R/flow.R @@ -10,7 +10,7 @@ #' @export vertex.disjoint.paths <- function(graph, source = NULL, target = NULL) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "vertex.disjoint.paths()", "vertex_disjoint_paths()" @@ -35,7 +35,7 @@ vertex.connectivity <- function( checks = TRUE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "vertex.connectivity()", "vertex_connectivity()" @@ -60,7 +60,7 @@ vertex.connectivity <- function( #' @export stMincuts <- function(graph, source, target, capacity = NULL) { # nocov start - lifecycle::deprecate_soft("2.0.0", "stMincuts()", "st_min_cuts()") + lifecycle::deprecate_warn("2.0.0", "stMincuts()", "st_min_cuts()") st_min_cuts( graph = graph, source = source, @@ -81,7 +81,7 @@ stMincuts <- function(graph, source, target, capacity = NULL) { #' @export stCuts <- function(graph, source, target) { # nocov start - lifecycle::deprecate_soft("2.0.0", "stCuts()", "st_cuts()") + lifecycle::deprecate_warn("2.0.0", "stCuts()", "st_cuts()") st_cuts(graph = graph, source = source, target = target) } # nocov end @@ -97,7 +97,7 @@ stCuts <- function(graph, source, target) { #' @export minimum.size.separators <- function(graph) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "minimum.size.separators()", "min_separators()" @@ -117,7 +117,7 @@ minimum.size.separators <- function(graph) { #' @export minimal.st.separators <- function(graph) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "minimal.st.separators()", "min_st_separators()" @@ -137,7 +137,7 @@ minimal.st.separators <- function(graph) { #' @export is.separator <- function(graph, candidate) { # nocov start - lifecycle::deprecate_soft("2.0.0", "is.separator()", "is_separator()") + lifecycle::deprecate_warn("2.0.0", "is.separator()", "is_separator()") is_separator(graph = graph, candidate = candidate) } # nocov end @@ -153,7 +153,7 @@ is.separator <- function(graph, candidate) { #' @export is.minimal.separator <- function(graph, candidate) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "is.minimal.separator()", "is_min_separator()" @@ -179,7 +179,7 @@ graph.mincut <- function( value.only = TRUE ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "graph.mincut()", "min_cut()") + lifecycle::deprecate_warn("2.0.0", "graph.mincut()", "min_cut()") min_cut( graph = graph, source = source, @@ -201,7 +201,7 @@ graph.mincut <- function( #' @export graph.maxflow <- function(graph, source, target, capacity = NULL) { # nocov start - lifecycle::deprecate_soft("2.0.0", "graph.maxflow()", "max_flow()") + lifecycle::deprecate_warn("2.0.0", "graph.maxflow()", "max_flow()") max_flow(graph = graph, source = source, target = target, capacity = capacity) } # nocov end @@ -217,7 +217,7 @@ graph.maxflow <- function(graph, source, target, capacity = NULL) { #' @export graph.adhesion <- function(graph, checks = TRUE) { # nocov start - lifecycle::deprecate_soft("2.0.0", "graph.adhesion()", "adhesion()") + lifecycle::deprecate_warn("2.0.0", "graph.adhesion()", "adhesion()") adhesion(graph = graph, checks = checks) } # nocov end @@ -238,7 +238,7 @@ edge.disjoint.paths <- function( checks = TRUE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "edge.disjoint.paths()", "edge_connectivity()" @@ -268,7 +268,7 @@ edge.connectivity <- function( checks = TRUE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "edge.connectivity()", "edge_connectivity()" @@ -293,7 +293,7 @@ edge.connectivity <- function( #' @export dominator.tree <- function(graph, root, mode = c("out", "in", "all", "total")) { # nocov start - lifecycle::deprecate_soft("2.0.0", "dominator.tree()", "dominator_tree()") + lifecycle::deprecate_warn("2.0.0", "dominator.tree()", "dominator_tree()") dominator_tree(graph = graph, root = root, mode = mode) } # nocov end # IGraph R package diff --git a/R/foreign.R b/R/foreign.R index ebf9280b01d..b493c1fdb83 100644 --- a/R/foreign.R +++ b/R/foreign.R @@ -25,7 +25,7 @@ write.graph <- function( ... ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "write.graph()", "write_graph()") + lifecycle::deprecate_warn("2.0.0", "write.graph()", "write_graph()") write_graph(graph = graph, file = file, format = format, ...) } # nocov end @@ -55,7 +55,7 @@ read.graph <- function( ... ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "read.graph()", "read_graph()") + lifecycle::deprecate_warn("2.0.0", "read.graph()", "read_graph()") read_graph(file = file, format = format, ...) } # nocov end @@ -81,7 +81,7 @@ graph.graphdb <- function( directed = TRUE ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "graph.graphdb()", "graph_from_graphdb()") + lifecycle::deprecate_warn("2.0.0", "graph.graphdb()", "graph_from_graphdb()") graph_from_graphdb( url = url, prefix = prefix, diff --git a/R/games.R b/R/games.R index f37cb832403..17d42f7fd94 100644 --- a/R/games.R +++ b/R/games.R @@ -17,7 +17,7 @@ watts.strogatz.game <- function( multiple = FALSE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "watts.strogatz.game()", "sample_smallworld()" @@ -52,7 +52,7 @@ static.power.law.game <- function( finite.size.correction = TRUE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "static.power.law.game()", "sample_fitness_pl()" @@ -86,7 +86,7 @@ static.fitness.game <- function( multiple = FALSE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "static.fitness.game()", "sample_fitness()" @@ -118,7 +118,7 @@ sbm.game <- function( loops = FALSE ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "sbm.game()", "sample_sbm()") + lifecycle::deprecate_warn("2.0.0", "sbm.game()", "sample_sbm()") sample_sbm( n = n, pref.matrix = pref.matrix, @@ -148,7 +148,7 @@ preference.game <- function( loops = FALSE ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "preference.game()", "sample_pref()") + lifecycle::deprecate_warn("2.0.0", "preference.game()", "sample_pref()") sample_pref( nodes = nodes, types = types, @@ -178,7 +178,7 @@ lastcit.game <- function( directed = TRUE ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "lastcit.game()", "sample_last_cit()") + lifecycle::deprecate_warn("2.0.0", "lastcit.game()", "sample_last_cit()") sample_last_cit( n = n, edges = edges, @@ -200,7 +200,7 @@ lastcit.game <- function( #' @export k.regular.game <- function(no.of.nodes, k, directed = FALSE, multiple = FALSE) { # nocov start - lifecycle::deprecate_soft("2.0.0", "k.regular.game()", "sample_k_regular()") + lifecycle::deprecate_warn("2.0.0", "k.regular.game()", "sample_k_regular()") sample_k_regular( no.of.nodes = no.of.nodes, k = k, @@ -226,7 +226,7 @@ interconnected.islands.game <- function( n.inter ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "interconnected.islands.game()", "sample_islands()" @@ -251,7 +251,7 @@ interconnected.islands.game <- function( #' @export grg.game <- function(nodes, radius, torus = FALSE, coords = FALSE) { # nocov start - lifecycle::deprecate_soft("2.0.0", "grg.game()", "sample_grg()") + lifecycle::deprecate_warn("2.0.0", "grg.game()", "sample_grg()") sample_grg(nodes = nodes, radius = radius, torus = torus, coords = coords) } # nocov end @@ -267,7 +267,7 @@ grg.game <- function(nodes, radius, torus = FALSE, coords = FALSE) { #' @export growing.random.game <- function(n, m = 1, directed = TRUE, citation = FALSE) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "growing.random.game()", "sample_growing()" @@ -293,7 +293,7 @@ forest.fire.game <- function( directed = TRUE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "forest.fire.game()", "sample_forestfire()" @@ -326,7 +326,7 @@ establishment.game <- function( directed = FALSE ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "establishment.game()", "sample_traits()") + lifecycle::deprecate_warn("2.0.0", "establishment.game()", "sample_traits()") sample_traits( nodes = nodes, types = types, @@ -353,7 +353,7 @@ degree.sequence.game <- function( method = c("simple", "vl", "simple.no.multiple", "simple.no.multiple.uniform") ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "degree.sequence.game()", "sample_degseq()" @@ -377,7 +377,7 @@ connect.neighborhood <- function( mode = c("all", "out", "in", "total") ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "connect.neighborhood()", "connect()") + lifecycle::deprecate_warn("2.0.0", "connect.neighborhood()", "connect()") connect(graph = graph, order = order, mode = mode) } # nocov end @@ -400,7 +400,7 @@ citing.cited.type.game <- function( attr = TRUE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "citing.cited.type.game()", "sample_cit_cit_types()" @@ -434,7 +434,7 @@ cited.type.game <- function( attr = TRUE ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "cited.type.game()", "sample_cit_types()") + lifecycle::deprecate_warn("2.0.0", "cited.type.game()", "sample_cit_types()") sample_cit_types( n = n, edges = edges, @@ -464,7 +464,7 @@ callaway.traits.game <- function( directed = FALSE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "callaway.traits.game()", "sample_traits_callaway()" @@ -499,7 +499,7 @@ bipartite.random.game <- function( mode = c("out", "in", "all") ) { # nocov start - lifecycle::deprecate_warn( + lifecycle::deprecate_stop( "2.0.0", "bipartite.random.game()", details = "Use sample_bipartite_gnp() or sample_bipartite_gnm()" @@ -538,7 +538,7 @@ barabasi.game <- function( start.graph = NULL ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "barabasi.game()", "sample_pa()") + lifecycle::deprecate_warn("2.0.0", "barabasi.game()", "sample_pa()") sample_pa( n = n, power = power, @@ -576,7 +576,7 @@ ba.game <- function( start.graph = NULL ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "ba.game()", "sample_pa()") + lifecycle::deprecate_warn("2.0.0", "ba.game()", "sample_pa()") sample_pa( n = n, power = power, @@ -609,7 +609,7 @@ asymmetric.preference.game <- function( loops = FALSE ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "asymmetric.preference.game()", "sample_asym_pref()" @@ -650,7 +650,7 @@ aging.barabasi.game <- function( time.window = NULL ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "aging.barabasi.game()", "sample_pa_age()") + lifecycle::deprecate_warn("2.0.0", "aging.barabasi.game()", "sample_pa_age()") sample_pa_age( n = n, pa.exp = pa.exp, @@ -696,7 +696,7 @@ aging.ba.game <- function( time.window = NULL ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "aging.ba.game()", "sample_pa_age()") + lifecycle::deprecate_warn("2.0.0", "aging.ba.game()", "sample_pa_age()") sample_pa_age( n = n, pa.exp = pa.exp, @@ -742,7 +742,7 @@ aging.prefatt.game <- function( time.window = NULL ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "aging.prefatt.game()", "sample_pa_age()") + lifecycle::deprecate_warn("2.0.0", "aging.prefatt.game()", "sample_pa_age()") sample_pa_age( n = n, pa.exp = pa.exp, @@ -1158,10 +1158,10 @@ erdos.renyi.game <- function( type <- igraph_match_arg(type) if (type == "gnp") { - lifecycle::deprecate_soft("0.8.0", "erdos.renyi.game()", "sample_gnp()") + lifecycle::deprecate_warn("0.8.0", "erdos.renyi.game()", "sample_gnp()") sample_gnp(n = n, p = p.or.m, directed = directed, loops = loops) } else if (type == "gnm") { - lifecycle::deprecate_soft("0.8.0", "erdos.renyi.game()", "sample_gnm()") + lifecycle::deprecate_warn("0.8.0", "erdos.renyi.game()", "sample_gnm()") sample_gnm(n = n, m = p.or.m, directed = directed, loops = loops) } } @@ -1178,10 +1178,10 @@ random.graph.game <- function( type <- igraph_match_arg(type) if (type == "gnp") { - lifecycle::deprecate_soft("0.8.0", "random.graph.game()", "sample_gnp()") + lifecycle::deprecate_warn("0.8.0", "random.graph.game()", "sample_gnp()") sample_gnp(n = n, p = p.or.m, directed = directed, loops = loops) } else if (type == "gnm") { - lifecycle::deprecate_soft("0.8.0", "random.graph.game()", "sample_gnm()") + lifecycle::deprecate_warn("0.8.0", "random.graph.game()", "sample_gnm()") sample_gnm(n = n, m = p.or.m, directed = directed, loops = loops) } } @@ -1388,7 +1388,7 @@ sample_degseq <- function( ) if (method == "simple") { - lifecycle::deprecate_warn( + lifecycle::deprecate_stop( "2.1.0", "sample_degseq(method = 'must be configuration instead of simple')" ) @@ -1396,7 +1396,7 @@ sample_degseq <- function( } if (method == "simple.no.multiple") { - lifecycle::deprecate_warn( + lifecycle::deprecate_stop( "2.1.0", "sample_degseq(method = 'must be fast.heur.simple instead of simple.no.multiple')" ) @@ -1404,7 +1404,7 @@ sample_degseq <- function( } if (method == "simple.no.multiple.uniform") { - lifecycle::deprecate_warn( + lifecycle::deprecate_stop( "2.1.0", "sample_degseq(method = 'must be configuration.simple instead of simple.no.multiple.uniform')" ) @@ -2474,14 +2474,14 @@ sample_bipartite <- function( mode <- igraph_match_arg(mode) if (type == "gnp") { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.2.0", "sample_bipartite()", "sample_bipartite_gnp()" ) sample_bipartite_gnp(n1, n2, p, directed = directed, mode = mode) } else if (type == "gnm") { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.2.0", "sample_bipartite()", "sample_bipartite_gnm()" @@ -2497,14 +2497,14 @@ sample_bipartite <- function( #' @export bipartite <- function(..., type = NULL) { if (is.null(type) || type == "gnp") { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.1.3", "bipartite()", "bipartite_gnp()" ) bipartite_gnp(...) } else if (type == "gnm") { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.1.3", "bipartite()", "bipartite_gnm()" diff --git a/R/glet.R b/R/glet.R index 252b227cfe8..8122a59f55f 100644 --- a/R/glet.R +++ b/R/glet.R @@ -16,7 +16,7 @@ graphlets.project <- function( Mu = rep(1, length(cliques)) ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "graphlets.project()", "graphlet_proj()") + lifecycle::deprecate_warn("2.0.0", "graphlets.project()", "graphlet_proj()") graphlet_proj( graph = graph, weights = weights, @@ -38,7 +38,7 @@ graphlets.project <- function( #' @export graphlets.candidate.basis <- function(graph, weights = NULL) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "graphlets.candidate.basis()", "graphlet_basis()" diff --git a/R/hrg.R b/R/hrg.R index b8eb3c4a860..83f65d16c7d 100644 --- a/R/hrg.R +++ b/R/hrg.R @@ -16,7 +16,7 @@ hrg.predict <- function( num.bins = 25 ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "hrg.predict()", "predict_edges()") + lifecycle::deprecate_warn("2.0.0", "hrg.predict()", "predict_edges()") predict_edges( graph = graph, hrg = hrg, @@ -38,7 +38,7 @@ hrg.predict <- function( #' @export hrg.fit <- function(graph, hrg = NULL, start = FALSE, steps = 0) { # nocov start - lifecycle::deprecate_soft("2.0.0", "hrg.fit()", "fit_hrg()") + lifecycle::deprecate_warn("2.0.0", "hrg.fit()", "fit_hrg()") fit_hrg(graph = graph, hrg = hrg, start = start, steps = steps) } # nocov end @@ -54,7 +54,7 @@ hrg.fit <- function(graph, hrg = NULL, start = FALSE, steps = 0) { #' @export hrg.game <- function(hrg) { # nocov start - lifecycle::deprecate_soft("2.0.0", "hrg.game()", "sample_hrg()") + lifecycle::deprecate_warn("2.0.0", "hrg.game()", "sample_hrg()") sample_hrg(hrg = hrg) } # nocov end @@ -70,7 +70,7 @@ hrg.game <- function(hrg) { #' @export hrg.dendrogram <- function(hrg) { # nocov start - lifecycle::deprecate_soft("2.0.0", "hrg.dendrogram()", "hrg_tree()") + lifecycle::deprecate_warn("2.0.0", "hrg.dendrogram()", "hrg_tree()") hrg_tree(hrg = hrg) } # nocov end @@ -86,7 +86,7 @@ hrg.dendrogram <- function(hrg) { #' @export hrg.create <- function(graph, prob) { # nocov start - lifecycle::deprecate_soft("2.0.0", "hrg.create()", "hrg()") + lifecycle::deprecate_warn("2.0.0", "hrg.create()", "hrg()") hrg(graph = graph, prob = prob) } # nocov end @@ -107,7 +107,7 @@ hrg.consensus <- function( num.samples = 10000 ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "hrg.consensus()", "consensus_tree()") + lifecycle::deprecate_warn("2.0.0", "hrg.consensus()", "consensus_tree()") consensus_tree( graph = graph, hrg = hrg, diff --git a/R/incidence.R b/R/incidence.R index 3937ad025af..886aa1a9f8c 100644 --- a/R/incidence.R +++ b/R/incidence.R @@ -17,7 +17,7 @@ graph.incidence <- function( add.names = NULL ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "graph.incidence()", "graph_from_biadjacency_matrix()" @@ -271,7 +271,7 @@ graph_from_biadjacency_matrix <- function( #' @export from_incidence_matrix <- function(...) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", "graph_from_incidence_matrix()", "graph_from_biadjacency_matrix()" @@ -294,7 +294,7 @@ from_incidence_matrix <- function(...) { #' @export graph_from_incidence_matrix <- function(...) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", "graph_from_incidence_matrix()", "graph_from_biadjacency_matrix()" diff --git a/R/interface.R b/R/interface.R index 7533cfb8285..9cd977cb47c 100644 --- a/R/interface.R +++ b/R/interface.R @@ -10,7 +10,7 @@ #' @export is.directed <- function(graph) { # nocov start - lifecycle::deprecate_soft("2.0.0", "is.directed()", "is_directed()") + lifecycle::deprecate_warn("2.0.0", "is.directed()", "is_directed()") is_directed(graph = graph) } # nocov end @@ -26,7 +26,7 @@ is.directed <- function(graph) { #' @export delete.vertices <- function(graph, v) { # nocov start - lifecycle::deprecate_soft("2.0.0", "delete.vertices()", "delete_vertices()") + lifecycle::deprecate_warn("2.0.0", "delete.vertices()", "delete_vertices()") delete_vertices(graph = graph, v = v) } # nocov end @@ -42,7 +42,7 @@ delete.vertices <- function(graph, v) { #' @export delete.edges <- function(graph, edges) { # nocov start - lifecycle::deprecate_soft("2.0.0", "delete.edges()", "delete_edges()") + lifecycle::deprecate_warn("2.0.0", "delete.edges()", "delete_edges()") delete_edges(graph = graph, edges = edges) } # nocov end @@ -58,7 +58,7 @@ delete.edges <- function(graph, edges) { #' @export add.vertices <- function(graph, nv, ..., attr = list()) { # nocov start - lifecycle::deprecate_soft("2.0.0", "add.vertices()", "add_vertices()") + lifecycle::deprecate_warn("2.0.0", "add.vertices()", "add_vertices()") add_vertices(graph = graph, nv = nv, attr = attr, ...) } # nocov end @@ -74,7 +74,7 @@ add.vertices <- function(graph, nv, ..., attr = list()) { #' @export add.edges <- function(graph, edges, ..., attr = list()) { # nocov start - lifecycle::deprecate_soft("2.0.0", "add.edges()", "add_edges()") + lifecycle::deprecate_warn("2.0.0", "add.edges()", "add_edges()") add_edges(graph = graph, edges = edges, attr = attr, ...) } # nocov end # IGraph R package @@ -474,7 +474,7 @@ el_to_vec <- function(x, call = rlang::caller_env()) { "get_edge_ids(vp = 'is not allowed to be a 2 times 2 matrix')" ) } else if (nrow == 2) { - lifecycle::deprecate_warn( + lifecycle::deprecate_stop( "2.1.5", "get_edge_ids(vp = 'supplied as a matrix should be a n times 2 matrix, not 2 times n')", details = "either transpose the matrix with t() or convert it to a data.frame with two columns." @@ -584,9 +584,9 @@ get.edge.ids <- function( lifecycle::deprecate_stop("2.0.0", "get.edge.ids(multi = )") } - lifecycle::deprecate_soft("2.0.0", "get.edge.ids(multi = )") + lifecycle::deprecate_warn("2.0.0", "get.edge.ids(multi = )") } - lifecycle::deprecate_soft("2.1.0", "get.edge.ids()", "get_edge_ids()") + lifecycle::deprecate_warn("2.1.0", "get.edge.ids()", "get_edge_ids()") get_edge_ids(graph = graph, vp = vp, directed = directed, error = error) } diff --git a/R/iterators.R b/R/iterators.R index 2cfd3101348..0094a7b2c27 100644 --- a/R/iterators.R +++ b/R/iterators.R @@ -599,21 +599,12 @@ simple_vs_index <- function(x, i, na_ok = FALSE) { ) tmp[as.numeric(x)] } - nei <- function(...) { - lifecycle::deprecate_stop("2.1.0", "nei()", ".nei()") - } .innei <- function(v, mode = c("in", "all", "out", "total")) { .nei(v, mode = mode[1]) } - innei <- function(...) { - lifecycle::deprecate_stop("2.1.0", "innei()", ".innei()") - } .outnei <- function(v, mode = c("out", "all", "in", "total")) { .nei(v, mode = mode[1]) } - outnei <- function(...) { - lifecycle::deprecate_stop("2.1.0", "outnei()", ".outnei()") - } .inc <- function(e) { ## TRUE iff the vertex (in the vs) is incident ## to at least one edge in e @@ -630,12 +621,6 @@ simple_vs_index <- function(x, i, na_ok = FALSE) { ) tmp[as.numeric(x)] } - inc <- function(...) { - lifecycle::deprecate_stop("2.1.0", "inc()", ".inc()") - } - adj <- function(...) { - lifecycle::deprecate_stop("2.1.0", "adj()", ".inc()") - } .from <- function(e) { ## TRUE iff the vertex is the source of at least one edge in e if (is.logical(e)) { @@ -651,9 +636,6 @@ simple_vs_index <- function(x, i, na_ok = FALSE) { ) tmp[as.numeric(x)] } - from <- function(...) { - lifecycle::deprecate_stop("2.1.0", "from()", ".from()") - } .to <- function(e) { ## TRUE iff the vertex is the target of at least one edge in e if (is.logical(e)) { @@ -669,10 +651,6 @@ simple_vs_index <- function(x, i, na_ok = FALSE) { ) tmp[as.numeric(x)] } - to <- function(...) { - lifecycle::deprecate_stop("2.1.0", "to()", ".to()") - } - graph <- get_vs_graph(x) if (is.null(graph)) { @@ -694,18 +672,18 @@ simple_vs_index <- function(x, i, na_ok = FALSE) { # Functions (only visible if called or if no duplicate) top <- rlang::new_environment(list( .nei = .nei, - nei = nei, + nei = .nei, .innei = .innei, - innei = innei, + innei = .innei, .outnei = .outnei, - outnei = outnei, + outnei = .outnei, .inc = .inc, - inc = inc, - adj = adj, + inc = .inc, + adj = .inc, .from = .from, - from = from, + from = .from, .to = .to, - to = to, + to = .to, .data = list(attrs) )) @@ -992,12 +970,6 @@ simple_es_index <- function(x, i, na_ok = FALSE) { ) tmp[as.numeric(x)] } - adj <- function(...) { - lifecycle::deprecate_stop("2.1.0", "adj()", ".inc()") - } - inc <- function(...) { - lifecycle::deprecate_stop("2.1.0", "inc()", ".inc()") - } .from <- function(v) { ## TRUE iff the edge originates from at least one vertex in v on.exit(.Call(Rx_igraph_finalizer)) @@ -1010,9 +982,6 @@ simple_es_index <- function(x, i, na_ok = FALSE) { ) tmp[as.numeric(x)] } - from <- function(...) { - lifecycle::deprecate_stop("2.1.0", "from()", ".from()") - } .to <- function(v) { ## TRUE iff the edge points to at least one vertex in v on.exit(.Call(Rx_igraph_finalizer)) @@ -1025,10 +994,6 @@ simple_es_index <- function(x, i, na_ok = FALSE) { ) tmp[as.numeric(x)] } - to <- function(...) { - lifecycle::deprecate_stop("2.1.0", "to()", ".to()") - } - graph <- get_es_graph(x) if (is.null(graph)) { @@ -1045,12 +1010,12 @@ simple_es_index <- function(x, i, na_ok = FALSE) { # Functions (only visible if called or if no duplicate) top <- rlang::new_environment(list( .inc = .inc, - inc = inc, - adj = adj, + inc = .inc, + adj = .inc, .from = .from, - from = from, + from = .from, .to = .to, - to = to, + to = .to, `%--%` = `%--%`, `%->%` = `%->%`, `%<-%` = `%<-%` diff --git a/R/layout.R b/R/layout.R index 1f14bbe0fb6..cd1166e1b5b 100644 --- a/R/layout.R +++ b/R/layout.R @@ -10,7 +10,7 @@ #' @export piecewise.layout <- function(graph, layout = layout_with_kk, ...) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "piecewise.layout()", "layout_components()" @@ -38,7 +38,7 @@ layout.sugiyama <- function( attributes = c("default", "all", "none") ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "layout.sugiyama()", "layout_with_sugiyama()" @@ -66,7 +66,7 @@ layout.sugiyama <- function( #' @export layout.star <- function(graph, center = V(graph)[1], order = NULL) { # nocov start - lifecycle::deprecate_soft("2.0.0", "layout.star()", "layout_as_star()") + lifecycle::deprecate_warn("2.0.0", "layout.star()", "layout_as_star()") layout_as_star(graph = graph, center = center, order = order) } # nocov end @@ -90,7 +90,7 @@ layout.norm <- function( zmax = 1 ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "layout.norm()", "norm_coords()") + lifecycle::deprecate_warn("2.0.0", "layout.norm()", "norm_coords()") norm_coords( layout = layout, xmin = xmin, @@ -114,7 +114,7 @@ layout.norm <- function( #' @export layout.merge <- function(graphs, layouts, method = "dla") { # nocov start - lifecycle::deprecate_soft("2.0.0", "layout.merge()", "merge_coords()") + lifecycle::deprecate_warn("2.0.0", "layout.merge()", "merge_coords()") merge_coords(graphs = graphs, layouts = layouts, method = method) } # nocov end @@ -135,7 +135,7 @@ layout.mds <- function( options = arpack_defaults() ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "layout.mds()", "layout_with_mds()") + lifecycle::deprecate_warn("2.0.0", "layout.mds()", "layout_with_mds()") layout_with_mds(graph = graph, dist = dist, dim = dim, options = options) } # nocov end @@ -151,7 +151,7 @@ layout.mds <- function( #' @export layout.grid <- function(graph, width = 0, height = 0, dim = 2) { # nocov start - lifecycle::deprecate_soft("2.0.0", "layout.grid()", "layout_on_grid()") + lifecycle::deprecate_warn("2.0.0", "layout.grid()", "layout_on_grid()") layout_on_grid(graph = graph, width = width, height = height, dim = dim) } # nocov end @@ -176,7 +176,7 @@ layout.graphopt <- function( max.sa.movement = 5 ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "layout.graphopt()", "layout_with_graphopt()" @@ -212,7 +212,7 @@ layout.gem <- function( temp.init = sqrt(max(vcount(graph), 1)) ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "layout.gem()", "layout_with_gem()") + lifecycle::deprecate_warn("2.0.0", "layout.gem()", "layout_with_gem()") layout_with_gem( graph = graph, coords = coords, @@ -246,7 +246,7 @@ layout.davidson.harel <- function( weight.node.edge.dist = 0.2 * (1 - edge_density(graph)) ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "layout.davidson.harel()", "layout_with_dh()" @@ -283,7 +283,7 @@ layout.bipartite <- function( maxiter = 100 ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.0", "layout.bipartite()", "layout_as_bipartite()" @@ -309,7 +309,7 @@ layout.bipartite <- function( #' @export layout.auto <- function(graph, dim = 2, ...) { # nocov start - lifecycle::deprecate_soft("2.0.0", "layout.auto()", "layout_nicely()") + lifecycle::deprecate_warn("2.0.0", "layout.auto()", "layout_nicely()") layout_nicely(graph = graph, dim = dim, ...) } # nocov end @@ -890,7 +890,7 @@ as_tree <- function(...) layout_spec(layout_as_tree, ...) #' @keywords internal #' @export layout.reingold.tilford <- function(..., params = list()) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.1.0", "layout.reingold.tilford()", "layout_as_tree()" @@ -955,7 +955,7 @@ in_circle <- function(...) layout_spec(layout_in_circle, ...) #' @keywords internal #' @export layout.circle <- function(..., params = list()) { - lifecycle::deprecate_soft("2.1.0", "layout.circle()", "layout_in_circle()") + lifecycle::deprecate_warn("2.1.0", "layout.circle()", "layout_in_circle()") do_call(layout_in_circle, .args = c(list(...), params)) } @@ -1144,21 +1144,6 @@ layout_on_grid <- function(graph, width = 0, height = 0, dim = 2) { #' @param ... Passed to `layout_on_grid()`. #' @export on_grid <- function(...) layout_spec(layout_on_grid, ...) - - -#' Simple grid layout -#' @description -#' `r lifecycle::badge("deprecated")` -#' -#' Use [layout_on_grid()]. -#' @inheritParams layout_on_grid -#' @export -#' @export -#' @keywords internal -layout.grid.3d <- function(graph, width = 0, height = 0) { - lifecycle::deprecate_stop("2.1.0", "layout.grid.3d()", "layout_on_grid()") -} - ## ---------------------------------------------------------------- #' Graph layout with vertices on the surface of a sphere @@ -1203,7 +1188,7 @@ on_sphere <- function(...) layout_spec(layout_on_sphere, ...) #' @keywords internal #' @export layout.sphere <- function(..., params = list()) { - lifecycle::deprecate_soft("2.1.0", "layout.sphere()", "layout_on_sphere()") + lifecycle::deprecate_warn("2.1.0", "layout.sphere()", "layout_on_sphere()") do_call(layout_on_sphere, .args = c(list(...), params)) } @@ -1258,7 +1243,7 @@ randomly <- function(...) layout_spec(layout_randomly, ...) #' @keywords internal #' @export layout.random <- function(..., params = list()) { - lifecycle::deprecate_soft("2.1.0", "layout.random()", "layout_randomly()") + lifecycle::deprecate_warn("2.1.0", "layout.random()", "layout_randomly()") do_call(layout_randomly, .args = c(list(...), params)) } @@ -1624,7 +1609,7 @@ with_fr <- function(...) layout_spec(layout_with_fr, ...) #' @keywords internal #' @export layout.fruchterman.reingold <- function(..., params = list()) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.1.0", "layout.fruchterman.reingold()", "layout_with_fr()" @@ -1982,7 +1967,7 @@ with_kk <- function(...) layout_spec(layout_with_kk, ...) #' @keywords internal #' @export layout.kamada.kawai <- function(..., params = list()) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.1.0", "layout.kamada.kawai()", "layout_with_kk()" @@ -2068,7 +2053,7 @@ with_lgl <- function(...) layout_spec(layout_with_lgl, ...) #' @keywords internal #' @export layout.lgl <- function(..., params = list()) { - lifecycle::deprecate_soft("2.1.0", "layout.lgl()", "layout_with_lgl()") + lifecycle::deprecate_warn("2.1.0", "layout.lgl()", "layout_with_lgl()") do_call(layout_with_lgl, .args = c(list(...), params)) } @@ -2124,7 +2109,7 @@ layout_with_mds <- function( options = arpack_defaults() ) { if (is.function(options)) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "1.6.0", "layout_with_mds(options = 'must be a list')", details = c( @@ -2659,7 +2644,7 @@ layout_components <- function(graph, layout = layout_with_kk, ...) { #' @export #' @keywords internal layout.spring <- function(graph, ...) { - lifecycle::deprecate_warn("2.1.0", "layout.spring()", "layout_with_fr()") + lifecycle::deprecate_stop("2.1.0", "layout.spring()", "layout_with_fr()") layout_with_fr(graph) } @@ -2677,7 +2662,7 @@ layout.spring <- function(graph, ...) { #' @keywords internal #' @export layout.svd <- function(graph, ...) { - lifecycle::deprecate_warn("2.1.0", "layout.svd()", "layout_with_fr()") + lifecycle::deprecate_stop("2.1.0", "layout.svd()", "layout_with_fr()") layout_with_fr(graph) } @@ -2696,7 +2681,7 @@ layout.svd <- function(graph, ...) { #' @keywords internal #' @export layout.fruchterman.reingold.grid <- function(graph, ...) { - lifecycle::deprecate_warn( + lifecycle::deprecate_stop( "2.1.0", "layout.fruchterman.reingold.grid()", "layout_with_fr()" @@ -2723,7 +2708,7 @@ layout.drl <- function( dim = 2 ) { # nocov start - lifecycle::deprecate_soft("2.0.0", "layout.drl()", "layout_with_drl()") + lifecycle::deprecate_warn("2.0.0", "layout.drl()", "layout_with_drl()") layout_with_drl( graph = graph, use.seed = use.seed, diff --git a/R/make.R b/R/make.R index ebb264bed6f..9301e1552f1 100644 --- a/R/make.R +++ b/R/make.R @@ -18,7 +18,7 @@ graph <- function( simplify = TRUE ) { # nocov start - lifecycle::deprecate_soft("2.1.0", "graph()", "make_graph()") + lifecycle::deprecate_warn("2.1.0", "graph()", "make_graph()") if (inherits(edges, "formula")) { if (!missing(n)) { cli::cli_abort("{.arg n} should not be given for graph literals") @@ -143,7 +143,7 @@ graph.famous <- function( simplify = TRUE ) { # nocov start - lifecycle::deprecate_soft("2.1.0", "graph.famous()", "make_graph()") + lifecycle::deprecate_warn("2.1.0", "graph.famous()", "make_graph()") if (inherits(edges, "formula")) { if (!missing(n)) { cli::cli_abort("{.arg n} should not be given for graph literals") @@ -260,7 +260,7 @@ graph.famous <- function( #' @export line.graph <- function(graph) { # nocov start - lifecycle::deprecate_soft("2.1.0", "line.graph()", "make_line_graph()") + lifecycle::deprecate_warn("2.1.0", "line.graph()", "make_line_graph()") ensure_igraph(graph) res <- linegraph_impl( @@ -284,7 +284,7 @@ line.graph <- function(graph) { #' @export graph.ring <- function(n, directed = FALSE, mutual = FALSE, circular = TRUE) { # nocov start - lifecycle::deprecate_soft("2.1.0", "graph.ring()", "make_ring()") + lifecycle::deprecate_warn("2.1.0", "graph.ring()", "make_ring()") res <- ring_impl( n, directed, @@ -311,7 +311,7 @@ graph.ring <- function(n, directed = FALSE, mutual = FALSE, circular = TRUE) { #' @export graph.tree <- function(n, children = 2, mode = c("out", "in", "undirected")) { # nocov start - lifecycle::deprecate_soft("2.1.0", "graph.tree()", "make_tree()") + lifecycle::deprecate_warn("2.1.0", "graph.tree()", "make_tree()") mode <- igraph_match_arg(mode) res <- kary_tree_impl( @@ -343,7 +343,7 @@ graph.star <- function( center = 1 ) { # nocov start - lifecycle::deprecate_soft("2.1.0", "graph.star()", "make_star()") + lifecycle::deprecate_warn("2.1.0", "graph.star()", "make_star()") mode <- igraph_match_arg(mode) res <- star_impl( @@ -371,7 +371,7 @@ graph.star <- function( #' @export graph.lcf <- function(n, shifts, repeats = 1) { # nocov start - lifecycle::deprecate_soft("2.1.0", "graph.lcf()", "graph_from_lcf()") + lifecycle::deprecate_warn("2.1.0", "graph.lcf()", "graph_from_lcf()") # Use the _impl function lcf_vector_impl( n = n, @@ -401,14 +401,14 @@ graph.lattice <- function( circular = deprecated() ) { # nocov start - lifecycle::deprecate_soft("2.1.0", "graph.lattice()", "make_lattice()") + lifecycle::deprecate_warn("2.1.0", "graph.lattice()", "make_lattice()") if (is.numeric(length) && length != floor(length)) { cli::cli_warn("{.arg length} was rounded to the nearest integer.") length <- round(length) } if (lifecycle::is_present(circular)) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.3", "graph.lattice(circular = 'use periodic argument instead')", details = c("`circular` is now deprecated, use `periodic` instead.") @@ -459,7 +459,7 @@ graph.lattice <- function( #' @export graph.kautz <- function(m, n) { # nocov start - lifecycle::deprecate_soft("2.1.0", "graph.kautz()", "make_kautz_graph()") + lifecycle::deprecate_warn("2.1.0", "graph.kautz()", "make_kautz_graph()") res <- kautz_impl( m = m, n = n @@ -484,7 +484,7 @@ graph.kautz <- function(m, n) { #' @export graph.full.citation <- function(n, directed = TRUE) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.1.0", "graph.full.citation()", "make_full_citation_graph()" @@ -516,7 +516,7 @@ graph.full.bipartite <- function( mode = c("all", "out", "in") ) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.1.0", "graph.full.bipartite()", "make_full_bipartite_graph()" @@ -559,7 +559,7 @@ graph.full.bipartite <- function( #' @export graph.full <- function(n, directed = FALSE, loops = FALSE) { # nocov start - lifecycle::deprecate_soft("2.1.0", "graph.full()", "make_full_graph()") + lifecycle::deprecate_warn("2.1.0", "graph.full()", "make_full_graph()") res <- full_impl( n, directed, @@ -584,7 +584,7 @@ graph.full <- function(n, directed = FALSE, loops = FALSE) { #' @export graph.formula <- function(..., simplify = TRUE) { # nocov start - lifecycle::deprecate_soft("2.1.0", "graph.formula()", "graph_from_literal()") + lifecycle::deprecate_warn("2.1.0", "graph.formula()", "graph_from_literal()") mf <- as.list(match.call())[-1] graph_from_literal_i(mf) } # nocov end @@ -601,7 +601,7 @@ graph.formula <- function(..., simplify = TRUE) { #' @export graph.extended.chordal.ring <- function(n, w, directed = FALSE) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.1.0", "graph.extended.chordal.ring()", "make_chordal_ring()" @@ -630,7 +630,7 @@ graph.extended.chordal.ring <- function(n, w, directed = FALSE) { #' @export graph.empty <- function(n = 0, directed = TRUE) { # nocov start - lifecycle::deprecate_soft("2.1.0", "graph.empty()", "make_empty_graph()") + lifecycle::deprecate_warn("2.1.0", "graph.empty()", "make_empty_graph()") # Function call res <- empty_impl( n = n, @@ -652,7 +652,7 @@ graph.empty <- function(n = 0, directed = TRUE) { #' @export graph.de.bruijn <- function(m, n) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.1.0", "graph.de.bruijn()", "make_de_bruijn_graph()" @@ -681,7 +681,7 @@ graph.de.bruijn <- function(m, n) { #' @export graph.bipartite <- function(types, edges, directed = FALSE) { # nocov start - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.1.0", "graph.bipartite()", "make_bipartite_graph()" @@ -732,7 +732,7 @@ graph.bipartite <- function(types, edges, directed = FALSE) { #' @export graph.atlas <- function(n) { # nocov start - lifecycle::deprecate_soft("2.1.0", "graph.atlas()", "graph_from_atlas()") + lifecycle::deprecate_warn("2.1.0", "graph.atlas()", "graph_from_atlas()") res <- atlas_impl( number = n ) @@ -1023,7 +1023,7 @@ sample_ <- function(...) { #' graph_(cbind(1:5, 2:6), from_edgelist(directed = FALSE)) #' graph_(cbind(1:5, 2:6), from_edgelist(), directed = FALSE) graph_ <- function(...) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.1.0", "graph_()", details = c( @@ -1957,7 +1957,7 @@ make_lattice <- function( circular = deprecated() ) { if (lifecycle::is_present(circular)) { - lifecycle::deprecate_soft( + lifecycle::deprecate_warn( "2.0.3", "make_lattice(circular = 'use periodic argument instead')", details = c("`circular` is now deprecated, use `periodic` instead.") diff --git a/lifecycle-TODO.md b/lifecycle-TODO.md new file mode 100644 index 00000000000..e84f9e5ec37 --- /dev/null +++ b/lifecycle-TODO.md @@ -0,0 +1,216 @@ +# lifecycle bump — unresolved test failures + +These commits were made but left tests failing that need manual fixes (tests call deprecated functions expecting a result, not an error): + + + +## `feat!: bump make_lattice(circular = 'use periodic argument instead') from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph_() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph.atlas() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph.bipartite() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph.de.bruijn() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph.empty() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph.extended.chordal.ring() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph.formula() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph.full() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph.full.bipartite() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph.full.citation() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph.kautz() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph.lattice(circular = 'use periodic argument instead') from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph.lattice() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph.lcf() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph.star() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph.tree() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph.ring() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump line.graph() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph.famous() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + +## `feat!: bump graph() from deprecate_soft to deprecate_warn` + +- graph_from_literal() and simple undirected graphs +- graph_from_literal() and undirected explosion +- graph_from_literal() and simple directed graphs +- graph_from_literal() and directed explosion +- graph_from_literal(simplify = FALSE) +- graph is not updated if not in LHS +- graph is updated if in LHS + diff --git a/tests/testthat/_snaps/centrality.md b/tests/testthat/_snaps/centrality.md index f6ffca6419b..bcb12bae957 100644 --- a/tests/testthat/_snaps/centrality.md +++ b/tests/testthat/_snaps/centrality.md @@ -38,8 +38,8 @@ Code invisible(eigen_centrality(g, scale = FALSE)) Condition - Warning: - The `scale` argument of `eigen_centrality()` always as if TRUE as of igraph 2.1.1. + Error: + ! The `scale` argument of `eigen_centrality()` always as if TRUE as of igraph 2.1.1. i Normalization is always performed # arpack() errors well diff --git a/tests/testthat/_snaps/community.md b/tests/testthat/_snaps/community.md index e01280a95f5..757b8b0be73 100644 --- a/tests/testthat/_snaps/community.md +++ b/tests/testthat/_snaps/community.md @@ -1,8 +1,8 @@ -# modularity_matrix still accepts a membership argument for compatibility +# modularity_matrix no longer accepts a membership argument for compatibility Code x <- modularity_matrix(karate, membership = rep(1, vcount(karate))) Condition - Warning: - The `membership` argument of `modularity_matrix()` is no longer used as of igraph 2.1.0. + Error: + ! The `membership` argument of `modularity_matrix()` is no longer used as of igraph 2.1.0. diff --git a/tests/testthat/test-centrality.R b/tests/testthat/test-centrality.R index 71bd753a7e6..4c806459f42 100644 --- a/tests/testthat/test-centrality.R +++ b/tests/testthat/test-centrality.R @@ -838,7 +838,7 @@ test_that("eigen_centrality() deprecated scale argument", { invisible(eigen_centrality(g, scale = TRUE)) }) # For some reason, this produces different outputs on Windows and macOS - expect_snapshot({ + expect_snapshot(error = TRUE, { invisible(eigen_centrality(g, scale = FALSE)) }) }) diff --git a/tests/testthat/test-community.R b/tests/testthat/test-community.R index a5ba5644e72..6891cc9e76d 100644 --- a/tests/testthat/test-community.R +++ b/tests/testthat/test-community.R @@ -376,11 +376,11 @@ test_that("modularity_matrix works", { expect_equal(karate_modmat1, karate_modmat2) }) -test_that("modularity_matrix still accepts a membership argument for compatibility", { +test_that("modularity_matrix no longer accepts a membership argument for compatibility", { karate <- make_graph("zachary") - expect_snapshot( + expect_snapshot(error = TRUE, { x <- modularity_matrix(karate, membership = rep(1, vcount(karate))) - ) + }) }) test_that("cluster_louvain works", { diff --git a/tests/testthat/test-games.R b/tests/testthat/test-games.R index 46b4c1e7bb5..8f68f2842b0 100644 --- a/tests/testthat/test-games.R +++ b/tests/testthat/test-games.R @@ -155,17 +155,17 @@ test_that("sample_degseq supports the sample_(...) syntax", { test_that("sample_degseq works() -- old method names", { withr::local_options("lifecycle_verbosity" = "warning") - expect_warning( + expect_error( sample_degseq(c(1, 1, 2, 2, 2), method = "simple"), "must be" ) - expect_warning( + expect_error( sample_degseq(c(1, 1, 2, 2, 2), method = "simple.no.multiple"), "must be" ) - expect_warning( + expect_error( sample_degseq(c(1, 1, 2, 2, 2), method = "simple.no.multiple.uniform"), "must be" ) diff --git a/tests/testthat/test-interface.R b/tests/testthat/test-interface.R index 0e73189645e..9be76e65bc9 100644 --- a/tests/testthat/test-interface.R +++ b/tests/testthat/test-interface.R @@ -220,7 +220,7 @@ test_that("get_edge_id() errors correctly for wrong matrices", { mat <- matrix(c(1, 2, 3, 4), nrow = 2, ncol = 2) lifecycle::expect_defunct(get_edge_ids(g, mat)) mat <- matrix(c(1, 2, 1, 3, 1, 4), nrow = 2, ncol = 3) - lifecycle::expect_deprecated(get_edge_ids(g, mat)) + lifecycle::expect_defunct(get_edge_ids(g, mat)) }) test_that("invalidate_cache works", { diff --git a/tools/bump-lifecycle.R b/tools/bump-lifecycle.R new file mode 100644 index 00000000000..24bccd6e139 --- /dev/null +++ b/tools/bump-lifecycle.R @@ -0,0 +1,440 @@ +library(treesitter) +library(treesitter.r) + +# --- Reset to baseline (undo any previous partial run) --- +# .claude/settings.local.json is untracked, so git reset --hard leaves it alone. +# This script is tracked, so we save and restore it across the reset. +local({ + baseline <- "fb68fc60b2e673a2994885ed454dbbaca709096c" + script_path <- here::here("tools", "bump-lifecycle.R") + saved <- readLines(script_path, warn = FALSE) + cli::cli_alert_info("Resetting to {substr(baseline, 1L, 7L)} ...") + system2("git", c("-C", here::here(), "reset", "--hard", baseline)) + writeLines(saved, script_path) + cli::cli_alert_success("Restored tools/bump-lifecycle.R") +}) + +lang <- treesitter.r::language() + +# deprecate_soft / deprecate_warn / deprecate_stop are all 14 chars — same length, +# so substr<-() replacement never shifts line/column positions. +next_level <- c( + deprecate_soft = "deprecate_warn", + deprecate_warn = "deprecate_stop" +) + +# Uncomment to inspect node types for a sample expression: +# text <- 'lifecycle::deprecate_soft("1.0.0", "foo()")' +# node_show_s_expression(tree_root_node(parser_parse(parser(lang), text))) + +# --- tree navigation helpers --- + +fn_to_call <- function(fn_node) { + # "deprecate_X" identifier -> namespace_operator -> call + node_parent(node_parent(fn_node)) +} + +# A pure shim is a function whose body contains exactly one statement: the deprecate_stop() call. +is_pure_shim <- function(fn_node) { + call_node <- fn_to_call(fn_node) + body_node <- node_parent(call_node) # braced_expression (the { } body) + fn_def_node <- node_parent(body_node) # function_definition + asgn_node <- node_parent(fn_def_node) # binary_operator (<-) + + if (node_type(fn_def_node) != "function_definition") { + return(FALSE) + } + if (node_type(asgn_node) != "binary_operator") { + return(FALSE) + } + length(node_named_children(body_node)) == 1L +} + +get_asgn_node <- function(fn_node) { + node_parent(node_parent(node_parent(fn_to_call(fn_node)))) +} + +get_fn_name <- function(fn_node) { + node_text(node_named_children(get_asgn_node(fn_node))[[1L]]) +} + +# Returns TRUE if fn_name appears as an identifier in any R file other than current_path. +# Used to protect shims that are still referenced internally. +is_referenced_elsewhere <- function(fn_name, current_path) { + escaped <- gsub("([.^$|*+?(){}\\[\\]])", "\\\\\\1", fn_name) + pattern <- paste0("(?= 1L && grepl("^\\s*(#'.*)?$", lines[i])) { + i <- i - 1L + } + if (i + 1L > first_fn_line - 1L) { + integer(0L) + } else { + seq(i + 1L, first_fn_line - 1L) + } +} + +# --- test helpers --- + +# Add `error = TRUE` to the expect_snapshot() call at row_1indexed in test_file. +add_error_true <- function(test_file, row_1indexed) { + if (!file.exists(test_file)) { + return(invisible(FALSE)) + } + lines <- readLines(test_file, warn = FALSE) + text <- paste(lines, collapse = "\n") + root <- tree_root_node(parser_parse(parser(lang), text)) + + q <- query( + lang, + '(call function: (identifier) @fn (#eq? @fn "expect_snapshot"))' + ) + caps <- query_captures(q, root) + fn_nodes <- caps$node[caps$name == "fn"] + + for (fn in fn_nodes) { + if (point_row(node_start_point(fn)) + 1L != row_1indexed) { + next + } + + call_node <- node_parent(fn) + args_node <- Filter( + \(n) node_type(n) == "arguments", + node_children(call_node) + ) + if (length(args_node) == 0L) { + next + } + args_node <- args_node[[1L]] + + if (grepl("error\\s*=\\s*TRUE", node_text(args_node))) { + return(invisible(FALSE)) + } + + # Insert `error = TRUE, ` right after the opening `(` + open_row <- point_row(node_start_point(args_node)) + 1L + open_col <- point_column(node_start_point(args_node)) + 1L + line <- lines[open_row] + lines[open_row] <- paste0( + substr(line, 1L, open_col), + "error = TRUE, ", + substr(line, open_col + 1L, nchar(line)) + ) + writeLines(lines, test_file) + return(invisible(TRUE)) + } + invisible(FALSE) +} + +# Patch expect_snapshot() calls for lifecycle errors found by run_one(). +# failures: list of {msg, src_file, line} returned from the callr subprocess. +fix_lifecycle_snapshot_failures <- function(failures, root) { + fixed <- FALSE + for (f in failures) { + if (!grepl("lifecycle_error_deprecated|defunctError|defunct", f$msg)) next + src_file <- f$src_file + line <- f$line + if (is.null(src_file) || is.null(line) || is.na(line)) next + file_path <- if (file.exists(src_file)) src_file else { + file.path(root, "tests", "testthat", basename(src_file)) + } + if (!file.exists(file_path)) next + if (add_error_true(file_path, line)) fixed <- TRUE + } + fixed +} + +# --- test runner --- + +# Accumulates {commit, tests} pairs for changes that left tests failing. +unresolved_failures <- list() +n_commits <- 0L + +# Returns character vector of still-failing test names (empty if all pass). +run_tests <- function(path) { + src_name <- fs::path_ext_remove(fs::path_file(path)) + test_file <- here::here("tests", "testthat", paste0("test-", src_name, ".R")) + if (!file.exists(test_file)) return(character(0)) + + root <- here::here() + + # Each call runs in a fresh subprocess — no memory accumulation in the main session. + run_one <- function(update_snapshots = FALSE) { + callr::r( + function(root, src_name, update_snapshots) { + if (update_snapshots) options(testthat.snapshot.update = TRUE) + result <- testthat::test_local( + root, filter = src_name, stop_on_failure = FALSE, reporter = "minimal" + ) + df <- as.data.frame(result) + failures <- list() + for (fr in result) { + for (exp in fr) { + if (!inherits(exp, c("expectation_failure", "expectation_error"))) next + msg <- tryCatch(conditionMessage(exp), error = function(e) "") + srcref <- tryCatch(exp$srcref, error = function(e) NULL) + src_file <- tryCatch(attr(srcref, "srcfile")$filename, error = function(e) NULL) + line <- tryCatch(as.integer(srcref)[1L], error = function(e) NA_integer_) + failures[[length(failures) + 1L]] <- list(msg = msg, src_file = src_file, line = line) + } + } + list( + n_fail = sum(df$failed, na.rm = TRUE) + sum(df$error, na.rm = TRUE), + bad_tests = df$test[df$failed + df$error > 0L], + failures = failures + ) + }, + args = list(root = root, src_name = src_name, update_snapshots = update_snapshots) + ) + } + + out <- run_one() + + if (out$n_fail > 0L && fix_lifecycle_snapshot_failures(out$failures, root)) { + out <- run_one() + } + + if (out$n_fail > 0L) { + out <- run_one(update_snapshots = TRUE) + if (out$n_fail > 0L) { + bad <- out$bad_tests + cli::cli_alert_warning( + "{out$n_fail} test(s) still failing after snapshot update (need manual fixes): {paste(bad, collapse = ', ')}" + ) + return(bad) + } + } + + character(0) +} + +commit_change <- function(path, msg) { + bad <- run_tests(path) + if (length(bad) > 0L) { + unresolved_failures[[length(unresolved_failures) + 1L]] <<- list( + commit = msg, + tests = bad + ) + } + gert::git_add(fs::path_rel(path, here::here())) + # Stage any modified test or snapshot files produced during the test run + status <- gert::git_status() + extra <- status$file[startsWith(status$file, "tests/") & !status$staged] + if (length(extra) > 0L) { + gert::git_add(extra) + } + gert::git_commit(msg) + n_commits <<- n_commits + 1L +} + +write_unresolved_report <- function() { + if (length(unresolved_failures) == 0L) return(invisible(NULL)) + out <- here::here("lifecycle-TODO.md") + lines <- c( + "# lifecycle bump — unresolved test failures", + "", + paste0( + "These commits were made but left tests failing that need manual fixes ", + "(tests call deprecated functions expecting a result, not an error):" + ), + "" + ) + for (item in unresolved_failures) { + lines <- c( + lines, + paste0("## `", item$commit, "`"), + "", + paste0("- ", item$tests), + "" + ) + } + writeLines(lines, out) + cli::cli_alert_warning("Wrote {length(unresolved_failures)} unresolved item(s) to lifecycle-TODO.md") +} + +# --- queries --- + +bump_query <- query( + lang, + ' + (call + function: (namespace_operator + lhs: (identifier) @ns + rhs: (identifier) @fn) + arguments: (arguments + (argument) + (argument value: (string content: (string_content) @what))) + (#eq? @ns "lifecycle") + (#match? @fn "^deprecate_(soft|warn)$")) +' +) + +stop_query <- query( + lang, + ' + (call + function: (namespace_operator + lhs: (identifier) @ns + rhs: (identifier) @fn) + arguments: (arguments + (argument) + (argument value: (string content: (string_content) @what))) + (#eq? @ns "lifecycle") + (#eq? @fn "deprecate_stop")) +' +) + +# --- per-file processing --- + +process_file <- function(path) { + + # ---- 1. BUMP: deprecate_soft -> deprecate_warn, deprecate_warn -> deprecate_stop ---- + + lines <- readLines(path, warn = FALSE) + root <- tree_root_node(parser_parse( + parser(lang), + paste(lines, collapse = "\n") + )) + matches <- query_matches(bump_query, root)[[1]] + + if (length(matches) > 0L) { + fn_nodes <- lapply(matches, \(m) m$node[m$name == "fn"][[1]]) + what_nodes <- lapply(matches, \(m) m$node[m$name == "what"][[1]]) + rows <- vapply(fn_nodes, \(n) point_row(node_start_point(n)), numeric(1)) + cols <- vapply(fn_nodes, \(n) point_column(node_start_point(n)), numeric(1)) + old_names <- vapply(fn_nodes, node_text, character(1)) + whats <- vapply(what_nodes, node_text, character(1)) + + # Calls with >2 args produce a duplicate match for the same @fn node. + # Keep only the first occurrence (args 1+2 = version+what). + dups <- duplicated(paste(rows, cols, sep = ":")) + fn_nodes <- fn_nodes[!dups] + what_nodes <- what_nodes[!dups] + rows <- rows[!dups] + cols <- cols[!dups] + old_names <- old_names[!dups] + whats <- whats[!dups] + + for (i in order(rows, decreasing = TRUE)) { + r <- rows[i] + 1L + c <- cols[i] + 1L + new_name <- next_level[[old_names[i]]] + substr(lines[r], c, c + 13L) <- new_name + writeLines(lines, path) + msg <- sprintf( + "feat!: bump %s from %s to %s", + whats[i], + old_names[i], + new_name + ) + commit_change(path, msg) + } + } + + # ---- 2. REMOVE: pure deprecate_stop shim functions ---- + + # Re-parse after bumps (newly-bumped deprecate_stop shims are included here). + lines <- readLines(path, warn = FALSE) + root <- tree_root_node(parser_parse( + parser(lang), + paste(lines, collapse = "\n") + )) + stop_matches <- query_matches(stop_query, root)[[1]] + fn_nodes <- lapply(stop_matches, \(m) m$node[m$name == "fn"][[1]]) + what_nodes <- lapply(stop_matches, \(m) m$node[m$name == "what"][[1]]) + + # Same deduplication: calls with a third argument (e.g. `with`) match twice. + if (length(fn_nodes) > 0L) { + stop_rows <- vapply( + fn_nodes, + \(n) point_row(node_start_point(n)), + numeric(1) + ) + stop_cols <- vapply( + fn_nodes, + \(n) point_column(node_start_point(n)), + numeric(1) + ) + stop_dups <- duplicated(paste(stop_rows, stop_cols, sep = ":")) + fn_nodes <- fn_nodes[!stop_dups] + what_nodes <- what_nodes[!stop_dups] + } + + if (length(fn_nodes) == 0L) { + return(invisible(NULL)) + } + + shim_mask <- vapply(fn_nodes, is_pure_shim, logical(1)) + fn_shims <- fn_nodes[shim_mask] + what_shims <- what_nodes[shim_mask] + if (length(fn_shims) == 0L) { + return(invisible(NULL)) + } + + asgn_nodes <- lapply(fn_shims, get_asgn_node) + starts <- vapply( + asgn_nodes, + \(n) point_row(node_start_point(n)) + 1L, + numeric(1) + ) + ends <- vapply(asgn_nodes, \(n) point_row(node_end_point(n)) + 1L, numeric(1)) + whats <- vapply(what_shims, node_text, character(1)) + + for (j in order(starts, decreasing = TRUE)) { + fn_name <- get_fn_name(fn_shims[[j]]) + if (is_referenced_elsewhere(fn_name, path)) { + cli::cli_alert_warning( + "Skipping removal of {fn_name}(): still referenced in other R files (fix iterators manually)" + ) + unresolved_failures[[length(unresolved_failures) + 1L]] <<- list( + commit = sprintf("feat!: remove deprecated %s (lifecycle::deprecate_stop)", whats[j]), + tests = paste0(fn_name, "() skipped: still referenced in other R files") + ) + next + } + lines <- readLines(path, warn = FALSE) + doc_range <- preceding_doc_range(lines, starts[j]) + fn_range <- seq(starts[j], ends[j]) + after_line <- ends[j] + 1L + trail <- if ( + after_line <= length(lines) && grepl("^\\s*$", lines[after_line]) + ) { + after_line + } else { + integer(0L) + } + writeLines(lines[-c(doc_range, fn_range, trail)], path) + msg <- sprintf( + "feat!: remove deprecated %s (lifecycle::deprecate_stop)", + whats[j] + ) + commit_change(path, msg) + } +} + +# --- run over all R source files --- + +r_files <- fs::dir_ls(here::here("R"), glob = "*.R") + +cli::cli_progress_bar( + total = length(r_files), + format = "{cli::pb_bar} {cli::pb_current}/{cli::pb_total} | {n_commits} commits | ETA {cli::pb_eta} | {cli::pb_status}", + format_done = "{cli::pb_total} files done | {n_commits} commits in {cli::pb_elapsed}", + clear = FALSE +) +for (path in r_files) { + cli::cli_progress_update(status = basename(path)) + process_file(path) + cli::cli_progress_update(inc = 1L) +} +cli::cli_progress_done() + +write_unresolved_report()