Bugfix release — modern chart decluttering
Fixes planet glyph ordering on style="modern" charts in tight clusters.
The bug
In a dense stellium (≥3 planets within ~8°) the old decluttering loop could push a planet past its neighbours, violating the true zodiacal order. Reported symptom: Neptune at 5° Aquarius rendered after Uranus at 17° Aquarius on the 2000-02-26 chart.
The fix
Rewrote _resolve_planet_collisions (kerykeion/charts/draw_modern.py) from a 5-pass iterative push (vulnerable to wraparound overshoots) to a single-pass largest-gap linearization:
- Sort once by true zodiacal angle.
- Cut the circle at the largest gap in those true angles.
- Walk forward once, placing each planet at
max(desired_linear, prev_linear + sep).
Monotonic by construction → order preserved, min_separation respected, no iterative refinement.
Compatibility
- No public API touched.
_resolve_planet_collisionsis private; noget_type_hints()impact.- Classic style unaffected.
Regression tests
tests/core/test_modern_decluttering.py — 13 tests including:
- unit invariants on empty/single/sparse/dense inputs
- the 2000-02-26 cluster (synthetic fixture + end-to-end SVG parse)
- property-based: 200 random dense clusters + 500 random full-circle distributions
- pathological cases: all-equal angles, long push chain crossing 0°/360°
Full changelog: https://github.com/g-battaglia/kerykeion/blob/v5.12.8/CHANGELOG.md