Skip to content

Investigate #68: pooled flood surface confirmed, max-per-watercourse fix rejected - #69

Merged
NewGraphEnvironment merged 9 commits into
mainfrom
68-fl-flood-depth-averages-every-stream-s-f
Oct 9, 2026
Merged

NewGraphEnvironment merged 9 commits into
mainfrom
68-fl-flood-depth-averages-every-stream-s-f

Conversation

@NewGraphEnvironment

Copy link
Copy Markdown
Owner

Summary

  • No package code changes. This PR records the investigation for fl_flood_depth() pools every stream's flood level; max-per-watercourse fix over-floods, needs drainage-based ownership #68 and the decision not to ship its candidate fix.
  • Mechanism confirmed on MORR co_ff04. The 451.9 ha (1.27%) loss reproduces exactly on main. 78.6% of the lost cells are dropped by the all-streams flood mask, which is the pooled IDW blend at work.
  • Candidate fix built, measured, rejected. The fix interpolates a separate surface per blue_line_key and keeps the cell-wise max. It passed every property test, including exact monotonicity in added blue lines. But it grows the bundled floodplain +67% (ff6) to +143% (ff2), and ff2 exceeds today's ff6. Per-order grouping does the same (+52% to +101%). The implementation and its tests are in history at d71bbb5 and reverted on the branch.
  • Adds research/flood_surface_interpolation.md, with the durable verdict and ^research$ in .Rbuildignore, and a CLAUDE.md design decision so the fix is not re-tried.

Related Issues

Test plan

  • No changes under R/, man/ or tests/. The branch diff is planning/, research/, CLAUDE.md and .Rbuildignore.
  • research/ excluded from the build (^research$)
  • CI green

Notes

  • Lineage. Nagel et al. (2014) set the flood height per stream segment and do not say how neighbouring segments combine. The blend comes from the Python VCA's pooled scipy griddata (BlueGeo / bcfishpass).
  • The blend has two errors that partly cancel. It lowers a river's waterline near small streams, and it hides steep tributaries carrying their waterline onto the mainstem floor. The second is much larger. Details are in planning/archive/2026-10-issue-68-flood-surface-blend/.

🤖 Generated with Claude Code

https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW

NewGraphEnvironment and others added 9 commits October 9, 2026 06:52
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
Failing on main by design: the bundled tile loses up to 12,220 valley cells
when a blue line is added, and the creek fixture loses 46 under the pooled IDW.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
fl_flood_depth(groups =), fl_flood_model(groups =) and
fl_valley_confine(group_field =, groups =) interpolate each watercourse's
waterline from its own cells and keep the highest. The #68 tests pass,
including exact monotonicity in added blue lines.

Not ready to merge: on the bundled tile the grouped extent is +67% to
+143% over the pooled one and grouped ff2 exceeds pooled ff6. Recorded in
findings.md; the default is held for a user decision. Four existing pins
fail under the new default (attribute fixture, stac vignette cache).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
The user chose no code for #68: the per-blue-line max extent is +67% to
+143% on the bundled tile and flood_factor nearly stops mattering.
Implementation and tests remain in history at d71bbb5. The PR carries the
measurements and the issue rewrite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
@NewGraphEnvironment
NewGraphEnvironment merged commit 2fc02a2 into main Oct 9, 2026
1 check passed
@NewGraphEnvironment
NewGraphEnvironment deleted the 68-fl-flood-depth-averages-every-stream-s-f branch October 9, 2026 14:20
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.

1 participant