Island-based gradient breaks: 85% reduction in barriers#87
Merged
NewGraphEnvironment merged 1 commit intomainfrom Apr 5, 2026
Merged
Island-based gradient breaks: 85% reduction in barriers#87NewGraphEnvironment merged 1 commit intomainfrom
NewGraphEnvironment merged 1 commit intomainfrom
Conversation
Replace interval-based gradient detection with vertex-based island approach adapted from bcfishpass. Computes gradient at every FWA vertex over a 100m upstream window, groups consecutive above-threshold vertices into islands, filters to islands >= 100m, returns one break at the entry of each island. Access barriers only (entry point = everything upstream blocked). Habitat classification uses segment attributes, not break presence. ADMS benchmarks: 15%: 28,960 → 4,229 barriers (85% reduction) 20%: 24,823 → 4,097 barriers (83% reduction) 25%: 21,295 → 3,824 barriers (82% reduction) Fixes locale-dependent numeric formatting (format() vs %s). Fixes #86 Relates to #83, #85 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace interval-based gradient detection with vertex-based island approach (adapted from bcfishpass
gradient_barriers_load.sql):Entry-only breaks are correct for access barriers — everything upstream is blocked. Habitat classification uses segment attributes directly, not break presence.
Performance
Test plan
devtools::test()— 528 pass, 0 failFixes #86
Relates to #83, #85
Relates to NewGraphEnvironment/sred-2025-2026#16
🤖 Generated with Claude Code