Skip to content

Commit

Permalink
feat: remove default value for 'loops' argument of centr_degree_tmax()
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle committed Jan 16, 2024
1 parent 74beaae commit ddfee36
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
16 changes: 10 additions & 6 deletions R/centralization.R
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ centr_degree <- centralization_degree_impl
#' @param mode This is the same as the `mode` argument of
#' `degree()`.
#' @param loops Logical scalar, whether to consider loops edges when
#' calculating the degree. Currently the default value is `FALSE`,
#' but this argument will be required from igraph 1.4.0.
#' calculating the degree.
#' @return Real scalar, the theoretical maximum (unnormalized) graph degree
#' centrality score for graphs with given order and other parameters.
#'
Expand All @@ -283,11 +282,16 @@ centr_degree <- centralization_degree_impl
centr_degree_tmax <- function(graph = NULL,
nodes = 0,
mode = c("all", "out", "in", "total"),
loops = FALSE) {
# Compatibility check with pre-igraph 1.3.0
if (missing(loops)) {
warning("centr_degree_tmax() will require an explicit value for its 'loops' argument from igraph 1.4.0. Assuming FALSE now.")
loops) {
if (!lifecycle::is_present(loops)) {
lifecycle::deprecate_warn(
when = "2.0.0",
what = "centr_degree_tmax(loops = 'must be explicit')",
details = "Default value (`FALSE`) will be dropped in next release, add an explicit value for the loops argument."
)
loops <- FALSE
}

# Argument checks
ensure_igraph(graph, optional = TRUE)

Expand Down
11 changes: 5 additions & 6 deletions man/centr_degree_tmax.Rd

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

0 comments on commit ddfee36

Please sign in to comment.