Skip to content

Numba-ize visibility module loops (#1177)#1179

Merged
brendancol merged 3 commits into
masterfrom
issue-1177
Apr 8, 2026
Merged

Numba-ize visibility module loops (#1177)#1179
brendancol merged 3 commits into
masterfrom
issue-1177

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Summary

  • JIT-compile _bresenham_line, _fresnel_radius_1, and the three inner loops of line_of_sight() (distance, visibility, Fresnel) with @ngjit
  • _bresenham_line now returns an (N, 2) int64 array instead of a list of tuples; _extract_transect and tests updated to match
  • New _los_kernel function fuses the distance, visibility, and Fresnel loops into a single numba-compiled pass

Test plan

  • All 25 existing visibility tests pass
  • Benchmarked: 2000-cell transect with Fresnel runs in ~0.19ms after JIT warmup

Closes #1177

JIT-compile _bresenham_line, _fresnel_radius_1, and the three inner
loops of line_of_sight (distance, visibility, Fresnel) via @ngjit.
_bresenham_line now returns an (N, 2) int64 array instead of a list
of tuples; _extract_transect and tests updated accordingly.
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label Apr 8, 2026
@brendancol brendancol merged commit 2ccbf9e into master Apr 8, 2026
11 checks passed
@brendancol brendancol deleted the issue-1177 branch May 4, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Numba-ize visibility module loops for performance

1 participant