fix: use get_igraph_from_adjacency for graph construction#4112
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4112 +/- ##
==========================================
- Coverage 79.61% 79.61% -0.01%
==========================================
Files 120 120
Lines 12782 12786 +4
==========================================
+ Hits 10176 10179 +3
- Misses 2606 2607 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
get_igraph_from_adjacency for graph construction for now.get_igraph_from_adjacency for now.
get_igraph_from_adjacency for now.get_igraph_from_adjacency for graph construction
|
This one is backwards-compatible, #4113 needs some more work due to igraph not handling sparse arrays (only matrices). |
ilan-gold
left a comment
There was a problem hiding this comment.
Just documentation stuff. I think we should be very clear what is going on, why, and what the plan is
| ) | ||
| raise | ||
| igraph_mode: str = ig.ADJ_DIRECTED if is_directed else ig.ADJ_UNDIRECTED | ||
| graph: ig.Graph = ig.Graph.Weighted_Adjacency(connectivities, mode=igraph_mode) |
There was a problem hiding this comment.
This is the change though right? Like users of modularity will start seeing a different number? And we're considering that a bug? Just want to be 100% clear. I would explain the rationale behind breaking this in the release note more
There was a problem hiding this comment.
Yes, and for scanpy 2.0 we’ll change it back again. Not 100% convinced with that back-and-forth, but changing it in leiden would mean to change its results or to create two graphs, one just for the modularity …
We could also not change this site and just merge the “in the future, do things like we do them here” part
There was a problem hiding this comment.
The path forward seems reasonable. I am fine with this. The above is a bug against our intention, to match leiden, and the way forward is to rectify an underlying bug with our intention, that leiden is using the wrong graph. The flip-flop is just the fact that we have two options in two places and made the wrong choice both times.
…y for graph construction) (#4134)
sc.tl.leidenandsc.metrics.modularityleads to modularity mismatch #4099