Skip to content
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

igraph::graph_from_adjacency_matrix() will start requiring symmetric adjacency matrices with mode='undirected' #27

Closed
szhorvat opened this issue Oct 26, 2023 · 1 comment · Fixed by #28
Labels
bug Something isn't working

Comments

@szhorvat
Copy link

szhorvat commented Oct 26, 2023

Describe the bug

graph_from_adjacency_matrix() is changing in igraph, and a future version will strictly require the input matrix to be symmetric if using mode='undirected'. This would cause some of the manynet tests to fail. If the non-symmetric input is intentional, choose a mode that is explicit about how to disambiguate between the above- and below-diagonal parts of the matrix.

Using mode='max' recovers the old behaviour and is compatible with earlier igraph.

Warning (test-make_read.R:124:3): read_ and write_ matrix works
The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be symmetric with mode = "undirected" as of igraph 1.5.2.
ℹ Use mode = "max" to achieve the original behavior.
Backtrace:
     ▆
  1. ├─testthat::expect_equal(...) at test-make_read.R:124:2
  2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
  3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
  4. ├─manynet::as_matrix(...)
  5. └─manynet::read_matrix(testthat::test_path("sheets", "test_matrix.csv")) at manynet/R/make_as.R:153:13
  6.   ├─manynet::as_tidygraph(as.matrix(out)) at manynet/R/make_read.R:89:2
  7.   └─manynet:::as_tidygraph.matrix(as.matrix(out)) at manynet/R/make_as.R:574:16
  8.     ├─tidygraph::as_tbl_graph(as_igraph(.data)) at manynet/R/make_as.R:597:2
  9.     ├─manynet::as_igraph(.data)
 10.     └─manynet:::as_igraph.matrix(.data) at manynet/R/make_as.R:301:13
 11.       └─igraph::graph_from_adjacency_matrix(...) at manynet/R/make_as.R:341:6

Provide system information

  • R version: 4.3.1
  • manynet version: Current main

To Reproduce

  • Installl development version of R/igraph using devtools::install_github("igraph/rigraph").
  • Run manynet test suite.
  • Observe warning (will turn into error at a later time)
@szhorvat szhorvat added the bug Something isn't working label Oct 26, 2023
@henriquesposito
Copy link
Contributor

@szhorvat Thank you for opening this issue and for the heads up.

@jaeltan jaeltan mentioned this issue Nov 1, 2023
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants