Skip to content

feat: expose voronoi to python #833

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

Draft
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

BeaMarton13
Copy link
Contributor

I used Cody for the functions.

  • By submitting this pull request, I assign the copyright of my contribution to The igraph development team.

@BeaMarton13 BeaMarton13 changed the title feat: expose voronoi python feat: expose voronoi to python Jun 16, 2025
@ntamas
Copy link
Member

ntamas commented Jun 16, 2025

Try to avoid re-formatting the .py files even if your IDE insists on reformatting. It makes it much harder to go through the PR and separate pure formatting-only modifications from the "real" part of the PR.

Copy link
Member

@szhorvat szhorvat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a few comments, not an exhaustive review.

Copy link
Member

@ntamas ntamas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a full review yet, I haven't checked the unit test and the Python side in detail. From a bird's eye view the Python side looks good.

@szhorvat szhorvat requested a review from Copilot June 22, 2025 13:05
Copy link

@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

This pull request exposes a new Voronoi community detection algorithm to Python.

  • Adds new test cases in tests/test_decomposition.py to validate the Voronoi clustering implementation.
  • Implements the _community_voronoi function in src/igraph/community.py with detailed documentation.
  • Updates the Python API and C extension bindings in src/igraph/init.py and src/_igraph/graphobject.c respectively.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/test_decomposition.py Introduces tests for the community_voronoi method using multiple graph scenarios.
src/igraph/community.py Implements the Voronoi clustering algorithm with comprehensive documentation.
src/igraph/init.py Exposes the new community_voronoi function through the public API.
src/_igraph/graphobject.c Adds the C extension binding for community_voronoi, handling Python–C argument conversion and result packaging.

@szhorvat
Copy link
Member

I think modularity should not be a parameter. Instead, let modularity be computed unconditionally. This takes little time compared to the rest of the algorithm.

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.

4 participants