Skip to content

Commit cad28ea

Browse files
committed
refactor!: change R/par.R
inline igraph_opt() and igraph_options()
1 parent 28435ff commit cad28ea

File tree

4 files changed

+78
-7
lines changed

4 files changed

+78
-7
lines changed

R/par.R

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,39 @@
11

2+
#' Parameters for the igraph package
3+
#'
4+
#' @description
5+
#' `r lifecycle::badge("deprecated")`
6+
#'
7+
#' `igraph.options()` was renamed to `igraph_options()` to create a more
8+
#' consistent API.
9+
#' @inheritParams igraph_options
10+
#' @keywords internal
11+
#' @export
12+
igraph.options <- function(...) { # nocov start
13+
lifecycle::deprecate_soft("2.0.0", "igraph.options()", "igraph_options()")
14+
igraph_i_options(...)
15+
} # nocov end
16+
17+
#' Parameters for the igraph package
18+
#'
19+
#' @description
20+
#' `r lifecycle::badge("deprecated")`
21+
#'
22+
#' `getIgraphOpt()` was renamed to `igraph_opt()` to create a more
23+
#' consistent API.
24+
#' @inheritParams igraph_opt
25+
#' @keywords internal
26+
#' @export
27+
getIgraphOpt <- function(x, default = NULL) { # nocov start
28+
lifecycle::deprecate_soft("2.0.0", "getIgraphOpt()", "igraph_opt()")
29+
30+
if (missing(default)) {
31+
get_config(paste0("igraph::", x), .igraph.pars[[x]])
32+
} else {
33+
get_config(paste0("igraph::", x), default)
34+
}
35+
} # nocov end
36+
237
# IGraph R package
338
# Copyright (C) 2005-2012 Gabor Csardi <[email protected]>
439
# 334 Harvard street, Cambridge, MA 02139 USA
@@ -126,7 +161,7 @@ igraph.pars.callbacks <- list("verbose" = igraph.pars.set.verbose)
126161
#' [attribute.combination()] for details on this.}
127162
#' }
128163
#'
129-
#' @aliases igraph.options igraph_options getIgraphOpt igraph_opt
164+
#' @aliases igraph_options igraph_opt
130165
#' @param \dots A list may be given as the only argument, or any number of
131166
#' arguments may be in the `name=value` form, or no argument at all may be
132167
#' given. See the Value and Details sections for explanation.
@@ -247,7 +282,3 @@ with_igraph_opt <- function(options, code) {
247282
old <- igraph_options(options)
248283
force(code)
249284
}
250-
#' @export getIgraphOpt
251-
deprecated("getIgraphOpt", igraph_opt)
252-
#' @export igraph.options
253-
deprecated("igraph.options", igraph_options)

man/getIgraphOpt.Rd

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/igraph.options.Rd

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/igraph_options.Rd

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)