You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
link currently computes WSG drainage closure (every WSG a focal set drains through, downstream-first) inline in data-raw/study_area_wsgs.R — see NewGraphEnvironment/link@v0.40.5. The query reads public.wsg_outlet, joins focal → closure via f.outlet <@ w.outlet, sorts by nlevel(outlet) ASC.
This is FWA-topology — it belongs in fresh, not link. No bundle/species/overrides knowledge involved; pure network shape.
Proposed
frs_wsg_drainage(conn, wsgs)
wsgs: character vector of WSG codes (the focal set)
Returns: character vector covering the drainage closure (focal + every WSG they flow through), ordered downstream-first (nlevel(outlet) ASC)
Pure FWA topology — no bundle / species / overrides logic
Where it lives
R/frs_wsg_drainage.R. Sits alongside frs_wsg_species() as part of a frs_wsg_* family — the WSG-topology surface of fresh.
Why fresh, not link
wsg_outlet is FWA infrastructure. Drainage closure is a network-shape question with no link/bundle knowledge. Other fresh consumers (vignettes, ad-hoc analyses, future provincial drivers in other packages) want this without going through link.
Inline closure query in NewGraphEnvironment/link@v0.40.5data-raw/study_area_wsgs.R (lines computing wsg_outlet-based closure).
Composes with
link::lnk_wsg_resolve (NewGraphEnvironment/link#207) — the link wrapper adds the bundle's species-presence filter.
Naming considered
frs_wsg_drainage (chosen) is frs_wsg_*-family consistent. wsg is FWA-specific terminology — honest to fresh's current FWA-only scope. If fresh ever grows a second network (NHD/HUC), a network = "fwa" param can be introduced then (YAGNI today).
Problem
linkcurrently computes WSG drainage closure (every WSG a focal set drains through, downstream-first) inline indata-raw/study_area_wsgs.R— seeNewGraphEnvironment/link@v0.40.5. The query readspublic.wsg_outlet, joins focal → closure viaf.outlet <@ w.outlet, sorts bynlevel(outlet) ASC.This is FWA-topology — it belongs in
fresh, notlink. No bundle/species/overrides knowledge involved; pure network shape.Proposed
wsgs: character vector of WSG codes (the focal set)nlevel(outlet) ASC)Where it lives
R/frs_wsg_drainage.R. Sits alongsidefrs_wsg_species()as part of afrs_wsg_*family — the WSG-topology surface of fresh.Why fresh, not link
wsg_outletis FWA infrastructure. Drainage closure is a network-shape question with no link/bundle knowledge. Other fresh consumers (vignettes, ad-hoc analyses, future provincial drivers in other packages) want this without going through link.Acceptance
frs_wsg_drainage(conn, c("PARS","BULK"))returns the 15-WSG Skeena+Peace closure:KISP, KLUM, LKEL, LSKE, MSKE, USKE, BULK, FINA, LBTN, LPCE, MORR, PARA, PCEA, UPCE, PARS— matchesNewGraphEnvironment/link@v0.40.5study_area_wsgs.Routput@exampleReplaces
Inline closure query in
NewGraphEnvironment/link@v0.40.5data-raw/study_area_wsgs.R(lines computingwsg_outlet-based closure).Composes with
link::lnk_wsg_resolve(NewGraphEnvironment/link#207) — the link wrapper adds the bundle's species-presence filter.Naming considered
frs_wsg_drainage(chosen) isfrs_wsg_*-family consistent.wsgis FWA-specific terminology — honest to fresh's current FWA-only scope. If fresh ever grows a second network (NHD/HUC), anetwork = "fwa"param can be introduced then (YAGNI today).