-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
feat: remove deprecated functions before 1.0 #1352
Conversation
Current Aviator status
This PR was merged manually (without Aviator). Merging manually can negatively impact the performance of the queue. Consider using Aviator next time.
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
@krlmlr Is it right that we should just remove deprecated functions? |
I edited the top post and added information on what can / should be done. |
NAMESPACE
Outdated
@@ -483,8 +481,7 @@ export(hrg.fit) | |||
export(hrg.game) | |||
export(hrg.predict) | |||
export(hrg_tree) | |||
export(hub.score) | |||
export(hub_score) | |||
export(hub_and_authority_scores) |
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.
I suggest hits_scores()
here, see comment I linked
Thanks! |
Let me know if you need input here, for example on what parameters to set in the new function to get the behaviour of the old one. Regarding hub and authority scores, I expect that removing these without deprecation would cause quite the uproar. What could be done is to implement There will also be another change in these two functions, as well as |
|
Why would it break the interface? As for the |
Because Sorry, I didn't get regarding laplacian. It has also |
This will require a somewhat breaking change (which is why I kept pushing to do this for 2.0...) The big change is not We need to transition from the old boolean |
Re hub and authority scores: Currently the function returns a list with many named elements. The main result is in Is there anything I'm missing that may continue to be a problem? |
I notice you were working on The R interface shouldn't always directly mirror the raw C interface. The |
Sure. I think derpecation of old parameter name is quite easy. Can you clarify please about single logical value or a vector? You mean it should be handled on R side? |
Yes, it should be handled in R. I would not allow
The default should be This is both very convenient (in most cases people will pass a scalar only) and it is compatible with how the old |
In the top post I linked to relevant issues where I tried to describe what's needed for the non-trivial upgrades. If anything's unclear (as in this case) please ask :-) |
@maelle
I don't get what is missing in documentation, mentioned functions have |
I'll come back to this next week! |
Do we really want to remove the functions though? Shouldn't they be deprecated first? |
Above authority_score and hub_score you need #' @title Kleinberg's hub and authority centrality scores. |
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.
Can you please review with Maëlle?
For the test failure, the problem and solution pattern could look like this: wrapped <- function(a, b, c) {
list(a, b, c)
}
fun <- function(..., b = NULL, c = NULL) {
wrapped(..., a = 5, b = b, c = c)
}
fun(b = 2, c = 3)
#> [[1]]
#> [1] 5
#>
#> [[2]]
#> [1] 2
#>
#> [[3]]
#> [1] 3 fun(a = 1, b = 2, c = 3)
#> Error in wrapped(..., a = 5, b = b, c = c): formal argument "a" matched by multiple actual arguments fun <- function(..., a = NULL, b = NULL, c = NULL) {
a <- if (is.null(a)) 5 else a
wrapped(..., a = a, b = b, c = c)
}
fun(a = 1, b = 2, c = 3)
#> [[1]]
#> [1] 1
#>
#> [[2]]
#> [1] 2
#>
#> [[3]]
#> [1] 3 Created on 2024-05-30 with reprex v2.1.0 |
@Antonov548 I'll check out this PR locally and make the changes
|
Thanks. I have restored functions. Just pushed changes. |
In |
Or better: use |
@Antonov548 I do not understand why aaa-auto.R refers to igraph_hub_and_authority_scores:
# This is a temporary hack; we need to find a way to handle default values
# for dependencies. The problem is that the VERTEXINDEX type needs two
# dependencies: the graph and the vertex set, but we only have the graph
# in the argument list.
DEPS: weights ON graph, hub_vector ON graph V(graph), authority_vector ON graph V(graph) How do we best patch |
The example I tried adding pairs as a reprex of what's broken @Antonov548 library("igraphdata")
library("igraph")
#>
#> Attaching package: 'igraph'
#> The following objects are masked from 'package:stats':
#>
#> decompose, spectrum
#> The following object is masked from 'package:base':
#>
#> union data(macaque)
hits_scores(macaque)
#> This graph was created by an old(er) igraph version.
#> Call upgrade_graph() on it to use with the current igraph version
#> For now we convert it on the fly...
#> Error in names(res$hub.vector) <- vertex_attr(graph, "name", V(graph)): attempt to set an attribute on NULL Created on 2024-06-07 with reprex v2.1.0 |
To not spend time to make changes in stimulus I can propose following change. Please check last commit. I found a place in stimulus where |
He... I'm not sure what with GHA here. Maybe something wrong with cache. @krlmlr may you suggest please? |
I don't see a caching step, can you please be more specific? |
I mean this caches. I already had once the problem with them - https://github.com/igraph/rigraph/actions/caches. |
@krlmlr the issue wasn't the cache. I had some troubles with search in VS code, so that I didn't see another usage of removed function. But it's good right now and maybe it make sense to run check for packages once again. |
This looks green. Running revdepchecks. |
Looks good enough to me? |
Also looks good to me. Thanks for checking it. |
I'm on my phone and can't look properly, but this caught my eye:
This is changing a deprecated function, which is perhaps not a good idea? The circular / periodic parameters are otherwise not mandatory, right? |
The netropy issue is not our problem. Did anyone look and check that the tidygraph one also isn't? |
tidygraph is present in main, I think this was also something that we can/should fix, in addition to the @maelle: can you please take a closer look? This isn't meant to be a blocker for this PR, just something that we want to do before release. |
Absolutely! |
|
Thanks! |
Deprecated
igraph_bipartite_game()
— see Split sample_bipartite() into two functions for the G(n,m) and G(n,p) case #630 - not use at allUpdated
igraph_hub_score()
- replaced withigraph_hub_and_authority_scores()
, see Avoid using deprecated functions from igraph/C #1177 (comment)igraph_authority_score()
- replaced withigraph_hub_and_authority_scores()
, see Avoid using deprecated functions from igraph/C #1177 (comment)igraph_lattice()
— replace withigraph_square_lattice()
, see Updatemake_lattice()
/lattice()
#994igraph_laplacian()
— replace byigraph_get_laplacian()
igraph_erdos_renyi_game()
— not used in R.igraph_random_edge_walk()
— functionality merged intoigraph_random_walk()
.R side
hub_score()
- addedhits_scores
.hub_score
is deprecated and usehits_scores
under the hood.authority_score()
- addedhits_scores
.authority_score
is deprecated and usehits_scores
under the hood.make_lattice()
- usesquare_lattice()
.circular
parameter is deprecated. Addedperiodic
parameter.periodic
should be logical vector with same length asdim
or single value which will be converted to vector.laplacian_matrix
- use generatedget_laplacian_sparse_impl
andget_laplacian_impl
instead ofR_igraph_laplacian
.normalized
argument is deprecated with newnormalization
argument.igraph_erdos_renyi_game()
— not used in R.igraph_random_edge_walk()
— updatedrandom_edge_walk
to userandom_walk_impl
withedges
return.