Skip to content

Add type hints to modularitypruning - #14

Merged
ragibson merged 11 commits into
masterfrom
add-type-hints
Oct 15, 2026
Merged

ragibson merged 11 commits into
masterfrom
add-type-hints

Conversation

@ragibson

Copy link
Copy Markdown
Owner

This closes #8 and makes the package much more robust by allowing mypy (or other static analysis tools) to catch bugs automatically.

I've also added a few additional guards and removed the long-deprecated Louvain and Progress parts of the package, which will require a bump to the major version number. The Louvain functions still automatically shim to Leiden as before.

I've heavily rebased the commit history here to make it more intelligible.

Used `righttyper run --root utilities -m pytest -- -m "not serial" tests/`
Current package version pulled from GitHub (a18f2b0 from Sep 9 2026) since pip is greatly outdated
[X] __init__.py
[X] champ_utilities.py
[X] leiden_utilities.py
[X] louvain_utilities.py
[X] parameter_estimation.py
[X] parameter_estimation_utilities.py
[X] partition_utilities.py
[X] plotting.py
Also remove all use of Any in type hints
Drop Python 3.9 testing for newer typing features
@ragibson
ragibson merged commit bb024d5 into master Oct 15, 2026
6 checks passed
@ragibson
ragibson deleted the add-type-hints branch October 15, 2026 17:15
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.

Add type hints

1 participant