Skip to content

Conversation

natoverse
Copy link
Collaborator

Copies and re-implements pieces from graspologic for Leiden, modularity, and largest connected components to remove python dependency and use graspologic-native directly.

@natoverse natoverse requested a review from a team as a code owner September 9, 2025 00:20
@natoverse natoverse changed the base branch from main to v3/main September 9, 2025 00:27
Copy link
Contributor

@Copilot Copilot AI left a 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, and modularity 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.

@natoverse natoverse merged commit 04d9f58 into v3/main Sep 9, 2025
13 of 14 checks passed
@natoverse natoverse deleted the hierarchical-leiden branch September 9, 2025 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants