Add AOI resolver and frs_params() for habitat model pipeline#42
Merged
NewGraphEnvironment merged 3 commits intomainfrom Mar 16, 2026
Merged
Add AOI resolver and frs_params() for habitat model pipeline#42NewGraphEnvironment merged 3 commits intomainfrom
NewGraphEnvironment merged 3 commits intomainfrom
Conversation
Network-agnostic AOI resolver normalizes character codes, sf polygons, table+id lookups, and blk+measure delineation to SQL predicates. Partition table/column configurable via options() — defaults to FWA watershed groups, works with any partition scheme. .frs_db_available() enables integration tests to skip gracefully when no DB tunnel is available. 27 unit + integration tests. Relates to #34 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reads species thresholds from bcfishpass pg table, custom table, or local CSV. Returns named list keyed by species code with ranges sub-lists ready for frs_classify(). CSV path enables rapid scenario iteration without DB changes. 25 unit + integration tests. Bundled test CSV in inst/testdata/. Relates to #37 Co-Authored-By: Claude Opus 4.6 <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
.frs_resolve_aoi()internal helper — normalizes character codes, sf polygons, table+id lookups, and blk+measure delineation to SQL predicates. Network-agnostic viaoptions(fresh.partition_table, fresh.partition_col)..frs_db_available()for integration tests to skip gracefully without DB tunnel.frs_params()— loads species habitat thresholds from bcfishpass pg table, custom table, or local CSV. Returns named list withrangessub-lists ready forfrs_classify().52 unit + integration tests. Integration tests hit real DB when tunnel is up, skip otherwise.
Closes #34
Relates to #37
Relates to NewGraphEnvironment/sred-2025-2026#18
Test plan
inst/testdata/test_params.csv🤖 Generated with Claude Code