-
-
Notifications
You must be signed in to change notification settings - Fork 208
refactor: Rename algo to algorithm in page_rank(), feedback_arc_set() and feedback_vertex_set()
#2859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Rename algo to algorithm in page_rank(), feedback_arc_set() and feedback_vertex_set()
#2859
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,8 @@ subgraph.centrality <- function(graph, diag = FALSE) { | |
| #' `page.rank()` was renamed to [page_rank()] to create a more | ||
| #' consistent API. | ||
| #' @inheritParams page_rank | ||
| #' @param algo `r lifecycle::badge("deprecated")` Use `algorithm` in | ||
| #' [page_rank()] instead. | ||
| #' @keywords internal | ||
| #' @export | ||
| page.rank <- function( | ||
|
|
@@ -42,7 +44,7 @@ page.rank <- function( | |
| lifecycle::deprecate_warn("2.0.0", "page.rank()", "page_rank()") | ||
| page_rank( | ||
| graph = graph, | ||
| algo = algo, | ||
| algorithm = algo, | ||
| vids = vids, | ||
| directed = directed, | ||
| damping = damping, | ||
|
|
@@ -1884,7 +1886,7 @@ hub_score <- function( | |
| #' | ||
| #' @param graph The graph object. | ||
| #' @inheritParams rlang::args_dots_empty | ||
| #' @param algo Character scalar, which implementation to use to carry out the | ||
| #' @param algorithm Character scalar, which implementation to use to carry out the | ||
| #' calculation. The default is `"prpack"`, which uses the PRPACK library | ||
| #' (<https://github.com/dgleich/prpack>) to calculate PageRank scores | ||
| #' by solving a set of linear equations. This is a new implementation in igraph | ||
|
|
@@ -1953,7 +1955,7 @@ hub_score <- function( | |
| page_rank <- function( | ||
| graph, | ||
| ..., | ||
| algo = c("prpack", "arpack"), | ||
| algorithm = c("prpack", "arpack"), | ||
| vids = NULL, | ||
| directed = TRUE, | ||
| damping = 0.85, | ||
|
|
@@ -1975,7 +1977,7 @@ page_rank <- function( | |
| cli::cli_abort(base::c("Unexpected argument passed to {.fn page_rank}: {.arg {(.arg_extra)}}.", i = "Arguments after {.arg ...} must be spelled out in full."), call = base::parent.frame()) | ||
| } | ||
| base::c( | ||
| if (!base::missing(algo)) base::list(algo = algo), | ||
| if (!base::missing(algo)) base::list(algorithm = algo), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we namespace base functions?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| if (!base::missing(vids)) base::list(vids = vids), | ||
| if (!base::missing(directed)) base::list(directed = directed), | ||
| if (!base::missing(damping)) base::list(damping = damping), | ||
|
|
@@ -1988,7 +1990,7 @@ page_rank <- function( | |
| if (base::length(.arg_handle) > 0L) { | ||
| .arg_names <- base::names(.arg_handle) | ||
| .arg_conflict <- base::intersect(.arg_names, base::c( | ||
| if (!base::missing(algo)) "algo", | ||
| if (!base::missing(algorithm)) "algorithm", | ||
| if (!base::missing(vids)) "vids", | ||
| if (!base::missing(directed)) "directed", | ||
| if (!base::missing(damping)) "damping", | ||
|
|
@@ -2002,7 +2004,7 @@ page_rank <- function( | |
| "3.0.0", | ||
| what = base::I("Calling `page_rank()` with positional or abbreviated arguments"), | ||
| details = base::c( | ||
| i = base::paste0("Detected call: page_rank(", base::paste(base::c("graph", .arg_names), collapse = ", "), ")"), | ||
| i = base::paste0("Detected call: page_rank(", base::paste(base::c("graph", base::c(algorithm = "algo", vids = "vids", directed = "directed", damping = "damping", personalized = "personalized", weights = "weights", options = "options")[.arg_names]), collapse = ", "), ")"), | ||
| i = base::paste0("Use instead: page_rank(", base::paste(base::c("graph", base::paste0(.arg_names, " = ")), collapse = ", "), ")") | ||
| ) | ||
| ) | ||
|
|
@@ -2016,7 +2018,7 @@ page_rank <- function( | |
|
|
||
| personalized_pagerank_impl( | ||
| graph = graph, | ||
| algo = algo, | ||
| algo = algorithm, | ||
| vids = vids, | ||
| directed = directed, | ||
| damping = damping, | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -59,3 +59,13 @@ | |||||
| Error in `arpack()`: | ||||||
| ! Can't use unkown ARPACK options: unknown_thing1, unknown_thing2 | ||||||
|
|
||||||
| # page_rank(algo = ) is deprecated but still works | ||||||
|
|
||||||
| Code | ||||||
| res_legacy <- page_rank(star, algo = "prpack") | ||||||
| Condition | ||||||
| Warning: | ||||||
| Calling `page_rank()` with positional or abbreviated arguments was deprecated in igraph 3.0.0. | ||||||
| i Detected call: page_rank(graph, algo) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I wish this looked like this so that the two lines might have real parallelism. |
||||||
| i Use instead: page_rank(graph, algorithm = ) | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When will we get rid of those functions? Could we try
deprecate_stop()in a PR? They're dead weight we're carrying around.