Skip to content

Phase 5: native KDEEB hammer, drop Python dependency - #23

Merged
schochastics merged 1 commit into
mainfrom
phase-5-kdeeb-hammer
Jul 23, 2026
Merged

schochastics merged 1 commit into
mainfrom
phase-5-kdeeb-hammer

Conversation

@schochastics

Copy link
Copy Markdown
Owner

Sixth phase (see _docs/REFACTORING-PLAN.md). The headline dependency reduction.

What

  • src/kdeeb.cpp (kdeeb_iter): native kernel density estimation edge bundling (Hurter, Ersoy & Telea 2012) — the algorithm behind datashader's "hammer". Density grid → separable Gaussian blur → gradient advection → smoothing → arc-length resample, with the bandwidth decaying each iteration.
  • edge_bundle_hammer() rewritten to call it. Same bw/decay params plus tuning knobs (npoints, iterations, grid, step, smooth).
  • reticulate removed from Imports; the .onLoad Python config, shader_env, and install_bundle_py() are deleted. edgebundle now has no Python dependency.

Tests

Contract (x,y,index,group, 50 pts/edge), finiteness, endpoints fixed, and locality: nearby parallel edges bundle (spread 3 → ~0.01) while a distant edge stays separate. FAIL 0 | PASS 71.

Notes

  • Output differs from the datashader-backed version (noted in NEWS; free-to-break).
  • Not visually validated this session. A pure-R KDEEB lets vellumplot drop its Python caveat for mark_edge_bundle(type="hammer") — worth coordinating on the N13 side.

🤖 Generated with Claude Code

Reimplement edge_bundle_hammer() in C++ (src/kdeeb.cpp) as kernel density
estimation edge bundling (Hurter, Ersoy & Telea 2012): sample edges into
points, estimate a density field on a grid, advect points up the density
gradient, smooth and resample, shrinking the bandwidth each iteration.

This removes the reticulate/datashader dependency entirely: reticulate is
dropped from Imports, and the .onLoad Python config, shader_env, and
install_bundle_py() are removed. Bundling output differs from the old
datashader-backed version.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@schochastics
schochastics merged commit a4d892a into main Jul 23, 2026
@schochastics
schochastics deleted the phase-5-kdeeb-hammer branch July 23, 2026 20:17
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.

1 participant