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
It's callable only from bash. Not testable. Not reusable from R sessions, vignettes, or other drivers. The "what WSGs should we model?" decision is captured in a script when it should be a function.
lnk_wsg_resolve (chosen) — noun-first matches link's dominant pattern (lnk_pipeline_*, lnk_compare_*, lnk_barriers_*, lnk_persist_*). wsgs arg name (not focal) matches existing CLI vocabulary (--wsgs= in wsgs_run_pipeline.sh). loaded param kept for consistency with every other pipeline phase (lnk_pipeline_run, lnk_pipeline_load, etc.) — renaming would be a package-wide sweep, not a one-off.
Problem
data-raw/study_area_wsgs.Rdoes three things inline:public.wsg_outlet, compute drainage closure (DS-first)wsg_species_presence(trifecta + balance + run_provincial: filter dispatch list to bundle species (skip 15 known-empty WSGs) #157)It's callable only from bash. Not testable. Not reusable from R sessions, vignettes, or other drivers. The "what WSGs should we model?" decision is captured in a script when it should be a function.
Proposed
cfglnk_config()manifestloadedlnk_load_overrides(cfg)— carrieswsg_species_presencefor the #157 filter (consistent with the rest of link's API)wsgsNULL= all bundle-species WSGs (province mode)expandwsgsis non-NULL:TRUE(default) = closure-expand viafresh::frs_wsg_drainage;FALSE= use as-is (species-filter only)Returns: character vector of WSG codes, DS-first ordered when expanded.
Call patterns
Where it lives
R/lnk_wsg_resolve.R. Pre-stages alnk_wsg_*family if more WSG functions land (e.g.lnk_wsg_list,lnk_wsg_bucketsfor DS-first chunking across hosts).What it composes
fresh::frs_wsg_drainage()(fresh issue — blocker) for the topology closureloaded$wsg_species_presencefor the trifecta + balance + run_provincial: filter dispatch list to bundle species (skip 15 known-empty WSGs) #157 species filterDownstream change
data-raw/study_area_wsgs.Rshrinks to a thin CLI shim:--no-expand)cfg + loadedlnk_wsg_resolve()data-raw/study_area_run.shinterface unchanged externally (still shells tostudy_area_wsgs.R).Acceptance
lnk_wsg_resolve(cfg, loaded, wsgs = c("PARS","BULK"))reproduces the currentstudy_area_wsgs.Routput:KISP,KLUM,LKEL,LSKE,MSKE,USKE,BULK,FINA,LBTN,LPCE,MORR,PARA,PCEA,UPCE,PARS(15 WSGs)lnk_wsg_resolve(cfg, loaded)returns the full bundle-species province listexpand = FALSEreturns input verbatim (after species-filter)@exampledata-raw/study_area_wsgs.Rrewritten as CLI shim;study_area_run.shadapted, interface unchangedBlocked on
NewGraphEnvironment/fresh#211 (
frs_wsg_drainage)Replaces
Inline drainage-closure + species-filter logic in
NewGraphEnvironment/link@v0.40.5data-raw/study_area_wsgs.R.Related
id_segmentcartesian — adjacent persist correctness)Naming considered
lnk_wsg_resolve(chosen) — noun-first matches link's dominant pattern (lnk_pipeline_*,lnk_compare_*,lnk_barriers_*,lnk_persist_*).wsgsarg name (notfocal) matches existing CLI vocabulary (--wsgs=inwsgs_run_pipeline.sh).loadedparam kept for consistency with every other pipeline phase (lnk_pipeline_run,lnk_pipeline_load, etc.) — renaming would be a package-wide sweep, not a one-off.