Unified pipeline: frs_network_segment + frs_habitat_classify#88
Merged
NewGraphEnvironment merged 1 commit intomainfrom Apr 6, 2026
Merged
Unified pipeline: frs_network_segment + frs_habitat_classify#88NewGraphEnvironment merged 1 commit intomainfrom
NewGraphEnvironment merged 1 commit intomainfrom
Conversation
frs_network_segment: domain-agnostic network segmentation. Extracts base streams, enriches with channel width, assigns id_segment, applies break sources, recomputes gradient from new geometry. One table, one copy of geometry, shared across species. frs_habitat_classify: long-format habitat classification. One row per segment x species with accessible/spawning/rearing/lake_rearing. Species-specific accessibility via label filtering — gradient_15 blocks CO but not BT; gradient_25 blocks both. Tested: ADMS with 3 access thresholds (15/20/25%), 3 species. CO: 3,719 accessible. ST: 5,139. BT: 7,219. 19,048 segments x 3 species = 57,144 habitat rows, geometry stored once. Also: .frs_sql_num() for locale-safe numeric SQL, auto-index on label/id_segment/species_code columns. Fixes #83 Relates to #82, #86 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
Two new exported functions for the unified pipeline (#83):
frs_network_segment()— domain-agnostic network segmentation. Extracts, enriches, breaks at any number of sources, assignsid_segment. One table, one copy of geometry, shared across species.frs_habitat_classify()— long-format habitat classification. One row per segment x species. Species-specific accessibility via break label filtering (gradient_15 blocks CO but not BT).Also:
.frs_sql_num()for locale-safe numeric SQL, auto-indexing onlabel,id_segment,species_code.Output structure
Species-specific accessibility
Test plan
devtools::test()— 528 pass, 0 failid_segmentunique across all segmentsFixes #83
Relates to #82, #86
Relates to NewGraphEnvironment/sred-2025-2026#16
🤖 Generated with Claude Code