Skip to content

Add distance backend abstraction scaffold for issue #172 https://github.com/pysal/pointpats/issues/172#175

Draft
SidheshwarSarangal wants to merge 1 commit into
pysal:mainfrom
SidheshwarSarangal:feature/distance-backend
Draft

Add distance backend abstraction scaffold for issue #172 https://github.com/pysal/pointpats/issues/172#175
SidheshwarSarangal wants to merge 1 commit into
pysal:mainfrom
SidheshwarSarangal:feature/distance-backend

Conversation

@SidheshwarSarangal

Copy link
Copy Markdown

This PR introduces a small distance-backend abstraction to decouple
distance computation from point pattern statistics.

What this does

  • Adds a DistanceBackend interface
  • Provides a default EuclideanDistanceBackend (no behavior change)
  • Wires the backend into PointPattern without breaking initialization
  • Updates a representative distance call in k()
  • Adds a minimal unit test

What this does NOT do

  • No network logic yet
  • No API changes
  • No refactoring of existing statistics

This is intended as architectural groundwork for network-constrained
point patterns discussed in #172.

Refs #172

@codecov

codecov Bot commented Jan 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 58.06452% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.4%. Comparing base (d3d09b2) to head (6e34488).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pointpats/distance_statistics.py 0.0% 8 Missing ⚠️
pointpats/pointpattern.py 76.9% 3 Missing ⚠️
pointpats/distance.py 80.0% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #175     +/-   ##
=======================================
- Coverage   72.6%   72.4%   -0.2%     
=======================================
  Files         12      13      +1     
  Lines       2124    2145     +21     
=======================================
+ Hits        1543    1554     +11     
- Misses       581     591     +10     
Files with missing lines Coverage Δ
pointpats/distance.py 80.0% <80.0%> (ø)
pointpats/pointpattern.py 69.2% <76.9%> (+0.1%) ⬆️
pointpats/distance_statistics.py 15.0% <0.0%> (-0.5%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SidheshwarSarangal SidheshwarSarangal marked this pull request as ready for review January 16, 2026 05:49
@SidheshwarSarangal SidheshwarSarangal marked this pull request as draft January 16, 2026 05:50
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