v0.9.0
fa2 v0.9.0 — Modernized for Python 3.9-3.14, NetworkX 3.x, Cython 3.x
The first major release in 5+ years. Complete modernization while maintaining full backward compatibility with v0.3.x.
New Features
linLogMode: Logarithmic attractionF = log(1+d)for community detection (verified against Gephi source + paper)seedparameter: Reproducible layouts via seeded RNGcallbacks: Iteration hooks for animation and convergence monitoring- NetworkX 3.x support (also works with 2.7+)
- igraph support: Robust handling of weighted, edgeless, and directed graphs
Algorithm Fixes
- Fixed
strongGravityaxis bug (and→or— nodes on axes were silently skipped) - Fixed
logAttractionformula (was missinglog(1+d)term) - Fixed Barnes-Hut leaf double-repulsion (now uses one-sided force, matching Gephi reference)
- Fixed
Regionsingle-node mass center calculation - Added ZeroDivisionError guards in speed adjustment
Code Quality
assert→ properValueError/TypeErrorwith helpful messages- Parameter validation on all numeric inputs
- Input validation: symmetry (dense + sparse), pos shape, self-loop warning, directed graph rejection
- Type hints on all public API methods
- 112 tests, 100% coverage on
forceatlas2.py
Build & Compatibility
- Python 3.9–3.14 supported
- Cython 3.x build via
.pyx(replaces old.pxdapproach) pyproject.tomlwith setuptools backend- Pre-generated C file for installation without Cython
- GitHub Actions CI: 3 OSes × 5 Python versions + pure-Python job
Breaking Changes
- Python 2 dropped
adjustSizes=Truenow raisesNotImplementedError(was silently ignored)multiThreaded=Truenow raisesNotImplementedError(was silently ignored)- Invalid parameter values (negative
scalingRatio, etc.) now raiseValueError
Issues Closed
PRs Incorporated
PyPI: https://pypi.org/project/fa2/0.9.0/
pip install fa2==0.9.0