Skip to content

Record accuracy sweep results for corridor#1414

Merged
brendancol merged 2 commits intomainfrom
accuracy-sweep-corridor
May 2, 2026
Merged

Record accuracy sweep results for corridor#1414
brendancol merged 2 commits intomainfrom
accuracy-sweep-corridor

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Summary

  • Audited xrspatial/corridor.py against the 5 accuracy categories (precision loss, NaN/Inf propagation, off-by-one, projection corrections, backend inconsistency).
  • No CRIT/HIGH issues. One LOW: corridor inherits float32 from cost_distance so normalized = corridor - corridor_min can lose precision near the min when costs accumulate to large values. The arithmetic in corridor itself does not introduce extra loss.
  • NaN handling is correct: corridor.min() uses skipna=True, the result is checked with np.isfinite before normalization, and unreachable corridors return all-NaN.
  • All four backends route through pure xarray arithmetic. The threshold path dispatches to dask.where, cupy.where, or np.where via a try/except pattern.

Test plan

  • CSV updated with module, date, severity, categories, notes

No CRIT/HIGH issues found. One LOW issue noted: corridor inherits
float32 from cost_distance, which can lose precision near the min
when costs accumulate to large values (intrinsic to upstream dtype).
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label May 2, 2026
@brendancol
Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Co-authored-by: brendancol <433221+brendancol@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented May 2, 2026

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in 30c60be. The CSV now includes the corridor row from this branch alongside all rows added to main since the branch was created (bilateral, contour, edge_detection, diffusion, glcm, mahalanobis, normalize, sky_view_factor, worley).

@brendancol brendancol merged commit 91919c8 into main May 2, 2026
1 check was pending
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.

2 participants