Skip to content

Commit

Permalink
refactor!: change R/par.R
Browse files Browse the repository at this point in the history
inline igraph_opt() and igraph_options()
  • Loading branch information
maelle committed Jan 16, 2024
1 parent 28435ff commit cad28ea
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 7 deletions.
41 changes: 36 additions & 5 deletions R/par.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,39 @@

#' Parameters for the igraph package
#'
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' `igraph.options()` was renamed to `igraph_options()` to create a more
#' consistent API.
#' @inheritParams igraph_options
#' @keywords internal
#' @export
igraph.options <- function(...) { # nocov start
lifecycle::deprecate_soft("2.0.0", "igraph.options()", "igraph_options()")
igraph_i_options(...)
} # nocov end

#' Parameters for the igraph package
#'
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' `getIgraphOpt()` was renamed to `igraph_opt()` to create a more
#' consistent API.
#' @inheritParams igraph_opt
#' @keywords internal
#' @export
getIgraphOpt <- function(x, default = NULL) { # nocov start
lifecycle::deprecate_soft("2.0.0", "getIgraphOpt()", "igraph_opt()")

if (missing(default)) {
get_config(paste0("igraph::", x), .igraph.pars[[x]])
} else {
get_config(paste0("igraph::", x), default)
}
} # nocov end

# IGraph R package
# Copyright (C) 2005-2012 Gabor Csardi <[email protected]>
# 334 Harvard street, Cambridge, MA 02139 USA
Expand Down Expand Up @@ -126,7 +161,7 @@ igraph.pars.callbacks <- list("verbose" = igraph.pars.set.verbose)
#' [attribute.combination()] for details on this.}
#' }
#'
#' @aliases igraph.options igraph_options getIgraphOpt igraph_opt
#' @aliases igraph_options igraph_opt
#' @param \dots A list may be given as the only argument, or any number of
#' arguments may be in the `name=value` form, or no argument at all may be
#' given. See the Value and Details sections for explanation.
Expand Down Expand Up @@ -247,7 +282,3 @@ with_igraph_opt <- function(options, code) {
old <- igraph_options(options)
force(code)
}
#' @export getIgraphOpt
deprecated("getIgraphOpt", igraph_opt)
#' @export igraph.options
deprecated("igraph.options", igraph_options)
22 changes: 22 additions & 0 deletions man/getIgraphOpt.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions man/igraph.options.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions man/igraph_options.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cad28ea

Please sign in to comment.