Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -899,9 +899,6 @@
- `layout.kamada.kawai()` is now deprecated with a warning instead of a message.
- `layout.lgl()` is now deprecated with a warning instead of a message.
- `layout_with_mds()` is now deprecated with a warning instead of a message.
- `layout.spring()` is now defunct (errors instead of warning).
- `layout.svd()` is now defunct (errors instead of warning).
- `layout.fruchterman.reingold.grid()` is now defunct (errors instead of warning).
- `layout.drl()` is now deprecated with a warning instead of a message.
- `nei()` has been removed.
- `innei()` has been removed.
Expand Down
6 changes: 6 additions & 0 deletions R/attributes.R
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,12 @@ igraph.i.attribute.combination <- function(comb, allow_rename = FALSE) {
"Attribute combination element must be a function or character scalar."
)
}
# A plain loop, not lapply(): check_deprecated_function() reads the call
# stack to find out who igraph was called by, and a functional in between
# would hide the caller behind a frame of its own.
for (element in comb) {
check_deprecated_function(element)
}
if (is.null(names(comb))) {
names(comb) <- rep("", length(comb))
}
Expand Down
2 changes: 2 additions & 0 deletions R/cliques.R
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ clique.number <- function(graph) {
cliques <- function(graph, min = NULL, max = NULL, ..., callback = NULL) {
ensure_igraph(graph)
check_dots_empty()
check_deprecated_function(callback)

if (is.null(callback)) {
# Collector mode: use original implementation
Expand Down Expand Up @@ -308,6 +309,7 @@ max_cliques <- function(
) {
ensure_igraph(graph)
check_dots_empty()
check_deprecated_function(callback)

# Handle file and subset modes (original functionality)
if (!is.null(file)) {
Expand Down
1 change: 1 addition & 0 deletions R/community.R
Original file line number Diff line number Diff line change
Expand Up @@ -2562,6 +2562,7 @@ cluster_leading_eigen <- function(

# Argument checks
ensure_igraph(graph)
check_deprecated_function(callback)

steps <- as.numeric(steps)
if (is.null(weights) && "weight" %in% edge_attr_names(graph)) {
Expand Down
1 change: 1 addition & 0 deletions R/cycles.R
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ simple_cycles <- function(
# Argument checks
ensure_igraph(graph)
check_dots_empty()
check_deprecated_function(callback)

if (is.null(callback)) {
simple_cycles_impl(
Expand Down
11 changes: 8 additions & 3 deletions R/layout.R
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,7 @@ layout_nicely <- function(graph, dim = 2, ...) {
lay <- graph_attr(graph, "layout")
if (is.function(lay)) {
if (!identical(lay, layout_nicely)) {
check_deprecated_function(lay)
return(lay(graph, ...))
} else {
# nop, we'll deal with it later below
Expand Down Expand Up @@ -3409,6 +3410,7 @@ layout_components <- function(graph, layout = NULL, ...) {
if (is.null(layout)) {
layout <- layout_with_kk
}
check_deprecated_function(layout)

V(graph)$id <- seq(vcount(graph))
gl <- decompose(graph)
Expand All @@ -3433,7 +3435,8 @@ layout_components <- function(graph, layout = NULL, ...) {
#' @export
#' @keywords internal
layout.spring <- function(graph, ...) {
lifecycle::deprecate_stop("2.1.0", "layout.spring()", "layout_with_fr()")
lifecycle::deprecate_warn("2.1.0", "layout.spring()", "layout_with_fr()")
layout_with_fr(graph)
}

#' SVD layout, this was removed from igraph
Expand All @@ -3450,7 +3453,8 @@ layout.spring <- function(graph, ...) {
#' @keywords internal
#' @export
layout.svd <- function(graph, ...) {
lifecycle::deprecate_stop("2.1.0", "layout.svd()", "layout_with_fr()")
lifecycle::deprecate_warn("2.1.0", "layout.svd()", "layout_with_fr()")
layout_with_fr(graph)
}

#' Grid Fruchterman-Reingold layout, this was removed from igraph
Expand All @@ -3468,11 +3472,12 @@ layout.svd <- function(graph, ...) {
#' @keywords internal
#' @export
layout.fruchterman.reingold.grid <- function(graph, ...) {
lifecycle::deprecate_stop(
lifecycle::deprecate_warn(
"2.1.0",
"layout.fruchterman.reingold.grid()",
"layout_with_fr()"
)
layout_with_fr(graph)
}

#' The DrL graph layout generator
Expand Down
1 change: 1 addition & 0 deletions R/motifs.R
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ motifs <- function(
if (!is.null(cut.prob) && length(cut.prob) != size) {
cli::cli_abort("{.arg cut.prob} must be the same length as {.arg size}")
}
check_deprecated_function(callback)

# If callback is provided, use the callback implementation
if (!is.null(callback)) {
Expand Down
1 change: 1 addition & 0 deletions R/plot.common.R
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ i.parse.plot.params <- function(graph, params) {
ret <- function() {
v <- p[[type]][[name]]
if (is.function(v) && !dontcall) {
check_deprecated_function(v)
v <- v(graph)
}
if (is.null(range)) {
Expand Down
3 changes: 3 additions & 0 deletions R/plot.shapes.R
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,9 @@ add_shape <- function(
))
}

check_deprecated_function(clip)
check_deprecated_function(plot)

assign(shape, value = list(clip = clip, plot = plot), envir = .igraph.shapes)
do.call(igraph_options, parameters)
invisible(TRUE)
Expand Down
9 changes: 8 additions & 1 deletion R/printr.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ printer_callback <- function(fun) {
if (!is.function(fun)) {
warning("'fun' is not a function")
}
check_deprecated_function(fun)
add_class(fun, "printer_callback")
}

Expand All @@ -58,7 +59,12 @@ print_footer <- function(footer) {
}

print_head_foot <- function(head_foot) {
if (is.function(head_foot)) head_foot() else cat(head_foot)
if (is.function(head_foot)) {
check_deprecated_function(head_foot)
head_foot()
} else {
cat(head_foot)
}
}

#' Print the only the head of an R object
Expand Down Expand Up @@ -199,6 +205,7 @@ indent_print <- function(..., .indent = " ", .printer = NULL) {
if (is.null(.printer)) {
.printer <- print
}
check_deprecated_function(.printer)

if (length(.indent) != 1 || !is.character(.indent)) {
indent <- .indent # cli literal cannot start with a dot
Expand Down
1 change: 1 addition & 0 deletions R/scan.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ local_scan <- function(
stopifnot(
is.null(FUN) || is.function(FUN) || (is.character(FUN) && length(FUN) == 1)
)
check_deprecated_function(FUN)

## Logical
stopifnot(is.logical(weighted), length(weighted) == 1)
Expand Down
3 changes: 3 additions & 0 deletions R/structural-properties.R
Original file line number Diff line number Diff line change
Expand Up @@ -3795,6 +3795,7 @@ bfs <- function(
}
if (!is.null(callback)) {
callback <- as.function(callback)
check_deprecated_function(callback)
}

on.exit(.Call(Rx_igraph_finalizer))
Expand Down Expand Up @@ -4058,9 +4059,11 @@ dfs <- function(
unreachable <- as.logical(unreachable)
if (!is.null(in.callback)) {
in.callback <- as.function(in.callback)
check_deprecated_function(in.callback)
}
if (!is.null(out.callback)) {
out.callback <- as.function(out.callback)
check_deprecated_function(out.callback)
}

on.exit(.Call(Rx_igraph_finalizer))
Expand Down
1 change: 1 addition & 0 deletions R/tkplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ tk_center <- function(tkp.id) {
#' @export
tk_reshape <- function(tkp.id, newlayout, ..., params) {
# nocov start
check_deprecated_function(newlayout)
tkp <- .tkplot.get(tkp.id)
new_coords <- do_call(
newlayout,
Expand Down
2 changes: 2 additions & 0 deletions R/topology.R
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,7 @@ isomorphisms <- function(graph1, graph2, method = "vf2", ..., callback = NULL) {
"Only {.arg method} = {.val vf2} is currently supported."
)
}
check_deprecated_function(callback)

if (is.null(callback)) {
graph.get.isomorphisms.vf2(graph1, graph2, ...)
Expand Down Expand Up @@ -1191,6 +1192,7 @@ subgraph_isomorphisms <- function(
"Callback parameter is only supported for {.arg method} = {.val vf2}."
)
}
check_deprecated_function(callback)

if (method == "lad") {
graph.subisomorphic.lad(pattern, target, all.maps = TRUE, ...)$maps
Expand Down
Loading
Loading