-
Notifications
You must be signed in to change notification settings - Fork 742
fix: use weights to calculate modularity, fix umap tests #4045
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Make {func}`scanpy.metrics.modularity` actually use edge weights {smaller}`P Angerer` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -212,7 +212,7 @@ def modularity_array( | |
| 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) | ||
| return graph.modularity(_codes(labels)) | ||
| return graph.modularity(_codes(labels), "weight") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you explain this a bit? Why was this broken before?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the the In #3613 we forgot to specify that. |
||
|
|
||
|
|
||
| def _codes(labels: AnyArrayLike) -> AnyArrayLike: | ||
|
|
||
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.
required by umap 0.5.12