Skip to content

Auto-skip gradient/cw thresholds on lake/wetland rules#132

Merged
NewGraphEnvironment merged 1 commit into
mainfrom
131-skip-thresholds-waterbody
Apr 12, 2026
Merged

Auto-skip gradient/cw thresholds on lake/wetland rules#132
NewGraphEnvironment merged 1 commit into
mainfrom
131-skip-thresholds-waterbody

Conversation

@NewGraphEnvironment
Copy link
Copy Markdown
Owner

Summary

  • Auto-skip gradient and channel_width CSV threshold inheritance when a rule has waterbody_type: L (lake) or waterbody_type: W (wetland). Lake/wetland flow lines are routing lines through waterbodies — channel width is meaningless and gradient is near-zero.
  • Rule-level explicit overrides still apply if deliberately set. Only CSV inheritance is auto-skipped.
  • Removes the need for thresholds: false workaround on every lake/wetland rule in the YAML.
  • Fixes SK rearing: 134 km (with thresholds on lakes) -> 230 km (auto-skipped), matching bcfishpass v0.5.0 which only checks area_ha for lake rearing.

Test plan

  • 4 new tests: lake auto-skip, wetland auto-skip, river still inherits, lake with explicit override
  • Existing CO 4-rule test updated (lake rule now auto-skips: 2 gradient predicates not 3)
  • 669 tests pass
  • Code-check: clean

Fixes #131
Relates to NewGraphEnvironment/sred-2025-2026#16

When a rule has waterbody_type L or W, automatically set
inherit_thresholds = FALSE for gradient and channel_width. Lake
and wetland flow lines are routing lines through waterbodies —
channel width is meaningless on them and gradient is near-zero.

Rule-level explicit overrides (rule[["gradient"]] etc.) still apply
if deliberately set. Only CSV inheritance is auto-skipped.

Fixes SK rearing: 134 km (+thresholds) -> 230 km (-thresholds),
matching bcfishpass v0.5.0 which only checks area_ha for lake rearing.

4 new tests + 1 existing test updated. 669 tests pass.

Fixes #131

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@NewGraphEnvironment NewGraphEnvironment merged commit 9b72c96 into main Apr 12, 2026
1 check passed
@NewGraphEnvironment NewGraphEnvironment deleted the 131-skip-thresholds-waterbody branch April 12, 2026 07:24
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.

Skip gradient/channel_width thresholds on waterbody_type L rules automatically

1 participant