Repository navigation
Build the bundled and vignette stream data from link's tables (#87) - #91
Open
NewGraphEnvironment wants to merge 17 commits into
Open
NewGraphEnvironment wants to merge 17 commits into
NewGraphEnvironment wants to merge 17 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
network_extract.R reads link's default-config BULK run and joins upstream area and precipitation from fwapg. Same 50 segments and geometry; precip moves on 28 segments, one access value 1 -> 2, spawning/rearing are now logical and the id column is id_segment. testdata.R no longer writes streams.gpkg. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
wsg_vignette_data.R takes streams, access, habitat and mapping code from link's default-config run, upstream area and precipitation from fwapg, and stamps the link run in pars_meta.rds in place of bcfishpass.log. Context layers carry over from the previous gpkg when the shared database is unreachable, and the meta file records which. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
Plan-review fixes: stop unless fresh_default holds the expected BULK run, has rows for it, and the connection reaches a database with the schema. streams.gpkg gains watershed_group_code, since id_segment is unique only with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
The join test expects the shipped logical spawning/rearing under cols = NULL. Channel width is named as fwapg's, its real source. Claims that were already stale are corrected from measurement: the overlap ratio (2.28 / 2.21, not 2.4), the fallback share (5.4%, not 3.0%) and the reach length (5 km, not 8). Timing figures stay as dated records. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
9,386 order 3+ bull-trout-accessible segments from link's default run (8,436 from bcfishpass before); floodplain 40,888.2 -> 40,969.3 ha (+0.2%) on the same DEM. pars_meta.rds records the link run and where the context layers came from (carried over from 2ef5c89: the shared database was unreachable). The vignette states the source from it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
#87) NOTICE goes per attribute: upstream area from fwapg, precipitation and modelled widths from ClimateBC through fwapg (#85), access and habitat from link's default config. That config applies bcfishpass's override tables, so a scoped ODbL credit stays. The README caption no longer points at link's bcfishpass-config article. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
Code-check round 1: with PG_*_SHARE unset, frs_db_conn() reached fwapg, every context query failed inside try(), and the script dropped all four layers while recording them as fetched. Each layer now falls back to the carried copy on a query error, or stops when there is none, and pars_meta.rds records the source per layer. README no longer says fwapg has upstream area on every segment (fwapg#33). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
The 10 m guard count moves 28,727 -> 28,726 with the fwapg precipitation; the lidar runs move by 0.04%. test-vignette_data.R passes on it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
Code-check round 2: a run that stopped at a guard had already deleted pars.gpkg, losing the context layers it would carry over. The gpkg is now built in a tempfile and copied into place after the last layer, and the carried layers' origin is tracked per layer, inherited from the previous metadata, never taken from an uncommitted file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
) The final run from a clean tree records each carried context layer's origin (2ef5c89, where they were last fetched). Both scripts now point from their pinned run_id to the copy of it in inst/NOTICE.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
Code-check round 3. link's recompute rewrites access and mapping codes after the modelling run, so both scripts pin it too and NOTICE names it. The fwapg tables read live are recorded by row count. The carried layers' origin needs the gpkg and meta clean at one commit. A named streams query error stops the run, the copy refuses to drop a previous layer, and the gpkg is renamed into place rather than copied over. 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
Final run at 0823eba: pars_meta.rds names the recompute that wrote access and mapping codes (m1-...1b04b0, link a17e917) and the fwapg row counts read; floodplain unchanged at 455,215 cells. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW
) Code-check round 4. The recompute guard now requires the pinned recompute to have started after the pinned modelling run. A layer the previous run carried with an unknown origin stays NA rather than being credited to the current commit. A rejected gpkg is kept outside inst/, and a failed move cleans up its partial file. The meta comment no longer credits habitat flags to the recompute. 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
This branch has not been deployed
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
inst/testdata/streams.gpkg) and the Parsnip vignette streams (inst/vignette-data/pars.gpkg) now come from link'sdefaultconfiguration (fresh_default), with upstream area and precipitation joined from fwapg. bcfishpass's views are no longer read.data-raw/network_extract.Randdata-raw/wsg_vignette_data.Rpin both the link modelling run and the recompute that later rewrote access and mapping codes, and stop before writing when either has moved.pars_meta.rdsrecords the link run, the recompute, the fwapg state read, and the source of each context layer.inst/NOTICE.mdnow credits each attribute to its source. It keeps a scoped bcfishpass ODbL credit, because link'sdefaultconfig applies bcfishpass's barrier and habitat override tables. Present-tense numbers in the README, vignettes, roxygen and notes were re-measured; dated measurements stay as records.Breaking change to shipped data (for NEWS)
inst/testdata/streams.gpkgand thestreamslayer ofpars.gpkg:segmented_stream_id(character) is replaced byid_segment(integer);id_segmentis unique only together with the newwatershed_group_codecolumn.spawningandrearingare logical (TRUE/FALSE), not integer codes.linear_feature_idis added, and rows are ordered byblue_line_keyanddownstream_route_measure.fl_valley_join(cols = NULL)therefore now picks upspawningandrearingon the bundled tile.What moved
Related Issues
Test plan
devtools::test(): 584 passed, 0 failed, 0 skippedR CMD check: 0 errors, 0 warnings, 2 notes, both pre-existing (CITATION.cffandpkgdown/at the top level)pkgdown::check_pkgdown()clean; lintr finds 145 lints against 149 on mainpars_meta.rds/code-check branch: 4 rounds, ended by an enumeration of every write and provenance field in the data-raw scripts. Each fix is proven by a harness (planning/archive/2026-10-issue-87-link-sourced-data/findings.md)Notes
pars.gpkg, which was built at 2ef5c89 on 2026-10-13.pars_meta.rdsrecords this per layer.research/bundled_stream_data.md; the investigation, including the reviews, is in the planning archive.🤖 Generated with Claude Code
https://claude.ai/code/session_0186ZefY3qMPiW8pwnwwMuxW