refactor: use {lifecycle} for deprecation#1014
Conversation
Current Aviator status
This pull request is currently open (not queued). How to mergeTo merge this PR, comment 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.
|
483b08a to
779c868
Compare
e22d6fe to
5e3bdfa
Compare
| ℹ Please use `set_edge_attr()` instead. | ||
| > causal.effect("y", "x", G = g) | ||
| Error in simple_es_index(x, ii) : Unknown edge selected | ||
| Calls: causal.effect ... [ -> [.igraph.es -> lapply -> FUN -> simple_es_index |
There was a problem hiding this comment.
No idea why this is failing now.
| 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) | ||
| 4. └─cfid::import_graph(ig) | ||
| 5. └─cfid::dag(paste0(c(g_obs, g_unobs), collapse = "; ")) | ||
| 6. └─cfid:::stopifnot_(nzchar(x), "Argument `x` contains only whitespace or special characters.") |
| > q.arg = list(list(min=-pi, max=pi), list(min=-pi, max=pi), list(min=-pi, max=pi)) | ||
| > estimateGraph(f.mat=ishigami.fun, d=3, q.arg=q.arg, n.tot=10000, method="LiuOwen") | ||
| Error in (function (edges, n = max(edges), directed = TRUE) : | ||
| unused arguments (3, FALSE) |
There was a problem hiding this comment.
again related to how we pass the ... 👀
There was a problem hiding this comment.
now I'm wondering whether there are uncaught occurrences of the same issue for other deprecated functions, I'll check.
There was a problem hiding this comment.
although, in this case, I'm starting to think the error is one usage error that existed before but wasn't caught.
The code is graph(as.vector(t(E)), d , FALSE) where d is 3 and as.vector(t(E)) is c(1, 3). In make_graph(), the ... are for "when the graph is given via a literal". Here the edges are numeric. So we're in
Lines 612 to 627 in b806ec2
old_graph() function doesn't have more arguments.
There was a problem hiding this comment.
although, why did it used to work
There was a problem hiding this comment.
igraph::make_graph(c(1, 3), 3, FALSE)
#> IGRAPH 628f020 U--- 3 1 --
#> + edge from 628f020:
#> [1] 1--3
igraph::graph(c(1, 3), 3, FALSE)
#> Warning: `graph()` was deprecated in igraph 2.0.0.
#> ℹ Please use `make_graph()` instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
#> Error in (function (edges, n = max(edges), directed = TRUE) : unused arguments (3, FALSE)Created on 2024-01-08 with reprex v2.0.2
|
|
||
| Quitting from lines 46-56 [unnamed-chunk-5] (Tutorial.Rmd) | ||
| Error: processing vignette 'Tutorial.Rmd' failed with diagnostics: | ||
| At vendor/cigraph/src/graph/type_indexededgelist.c:101 : Number of vertices must not be negative. Invalid value |
| } | ||
|
|
||
| if (missing(simplify)) { | ||
| make_graph(edges = edges, n = n, isolates = isolates, directed = directed, ...) |
There was a problem hiding this comment.
Would this fail if edges is a formula?
I don't like the interface of make_graph(), but deprecating it is an uphill battle. Can we instead export all relevant functions (e.g., make_famous_graph()), and supersede it?
There was a problem hiding this comment.
let's open another issue regarding make_graph()'s superseding, and I'll do my best to fix the current graph() here in this PR.
|
I wonder how, in the problematic cases, we could "replay" the call exactly, just switching the function name. https://rlang.r-lib.org/reference/stack.html |
|
I'll come back to this later (this week or next), still some thinking needed. |
|
@krlmlr we could discuss the approach in |
|
The functions needing a similar fix are |
Fix #697
Fix #977