Conversation
Current Aviator status
This PR is currently in state
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.
|
| if (!missing(index)) { | ||
| index_is_natural_sequence <- (length(index) == vcount(graph) && | ||
| identical(index, seq(1, vcount(graph)))) | ||
| identical(index, V(graph))) |
There was a problem hiding this comment.
I still think this should be
| identical(index, V(graph))) | |
| identical(index, as.numeric(seq_len(vcount(graph))))) |
We want to cater for cases where !missing(index) but index is still essentially V(g) . I see:
library(igraph)
g <- make_ring(10)
identical(V(g), V(g))
#> [1] FALSECreated on 2024-07-18 with reprex v2.1.0
Similarly to #1432 (comment).
There was a problem hiding this comment.
graph <- make_ring(5)
index <- V(graph)
identical(index, as.numeric(seq_len(vcount(graph))))
# returns FALSE.
Try all(index == V(graph))
There was a problem hiding this comment.
@clpippel: all() is challenging if the vectors are of different length? We'd still want to check the lengths first.
Would the all() route be faster?
There was a problem hiding this comment.
Perhaps we also want to check isTRUE(attr(g, "is_all")) ?
options(conflicts.policy = list(warn = FALSE))
library(igraph)
g <- make_ring(10)
dput(V(g))
#> structure(1:10, class = "igraph.vs", is_all = TRUE, env = <weak reference>, graph = "516d6a01-f041-48ae-bbe3-60dd751a8f4b")Created on 2024-08-22 with reprex v2.1.0
Need to check if this other code path is ever touched -- easiest way by breaking it and running tests or revdeps.
|
Continuing in #1427. |
Fix #1432
Fix #1427
cc @krlmlr @clpippel