Skip to content

Commit

Permalink
fix: put deprecation message at the beginning not the end of the simi…
Browse files Browse the repository at this point in the history
…larity functions (#1549)
  • Loading branch information
aviator-app[bot] authored Oct 7, 2024
2 parents ca33036 + a2ecb57 commit dc019bb
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions R/similarity.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,21 @@ similarity.jaccard <- function(graph,
vids = V(graph),
mode = c("all", "out", "in", "total"),
loops = FALSE) {
similarity(
graph = graph,
vids = vids,
mode = mode,
loops = loops,
method = "jaccard"
)

lifecycle::deprecate_soft(
"2.1.0",
"similarity.jaccard()",
'similarity(method)',
details = 'similarity(method = "jaccard")'
)

similarity(
graph = graph,
vids = vids,
mode = mode,
loops = loops,
method = "jaccard"
)
}

#' Similarity measures of two vertices (Dice)
Expand All @@ -112,20 +113,21 @@ similarity.dice <- function(graph,
vids = V(graph),
mode = c("all", "out", "in", "total"),
loops = FALSE) {
similarity(
graph = graph,
vids = vids,
mode = mode,
loops = loops,
method = "dice"
)

lifecycle::deprecate_soft(
"2.1.0",
"similarity.dice()",
'similarity(method)',
details = 'similarity(method = "dice")'
)

similarity(
graph = graph,
vids = vids,
mode = mode,
loops = loops,
method = "dice"
)
}

#' Similarity measures of two vertices (inverse log-weighted)
Expand All @@ -140,17 +142,18 @@ similarity.dice <- function(graph,
similarity.invlogweighted <- function(graph,
vids = V(graph),
mode = c("all", "out", "in", "total")) {
similarity(
graph = graph,
vids = vids,
mode = mode,
method = "invlogweighted"
)

lifecycle::deprecate_soft(
"2.1.0",
"similarity.invlogweighted()",
'similarity(method)',
details = 'similarity(method = "invlogweighted")'
)

similarity(
graph = graph,
vids = vids,
mode = mode,
method = "invlogweighted"
)
}

0 comments on commit dc019bb

Please sign in to comment.