-
Notifications
You must be signed in to change notification settings - Fork 3k
Re-implement hierarchical Leiden #2049
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
Conversation
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.
Pull Request Overview
Re-implements hierarchical Leiden clustering and graph utilities to remove Python dependency on graspologic package and use graspologic-native directly. This change eliminates the need for the Python graspologic library while maintaining the same functionality.
- Implements local versions of
largest_connected_component
,hierarchical_leiden
, andmodularity
functions - Updates imports to use local implementations instead of graspologic package
- Adds graspologic-native dependency while keeping graspologic for compatibility
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
pyproject.toml | Updates dependencies to add graspologic-native and update graspologic version |
graphrag/index/utils/graphs.py | Adds local implementations of graph utilities to replace graspologic functions |
graphrag/index/utils/stable_lcc.py | Updates import to use local largest_connected_component implementation |
graphrag/index/operations/prune_graph.py | Updates import to use local largest_connected_component implementation |
graphrag/index/operations/cluster_graph.py | Updates import to use local hierarchical_leiden implementation |
tests/unit/indexing/graph/utils/test_stable_lcc.py | Removes duplicate test methods that were testing the same functionality |
.semversioner/next-release/major-20250909002702300683.json | Adds semver entry for major version change |
Comments suppressed due to low confidence (1)
graphrag/index/utils/graphs.py:1
- The default case has been removed from the match statement but the function no longer returns a value when an unknown modularity metric is provided. This will cause the function to return None instead of raising an error.
# Copyright (c) 2024 Microsoft Corporation.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Copies and re-implements pieces from graspologic for Leiden, modularity, and largest connected components to remove python dependency and use graspologic-native directly.