Skip to contents

The species the config classifies, filtered to those present in the AOI. Used by lnk_pipeline_classify() and lnk_pipeline_connect() to pick which species to run, and exposed for callers that need to derive the same list outside the pipeline (e.g. a custom compare_bcfishpass_wsg() that queries bcfishpass reference tables only for these species).

Usage

lnk_pipeline_species(cfg, loaded, aoi, paused = FALSE)

Arguments

cfg

An lnk_config object from lnk_config().

loaded

Named list of tibbles from lnk_load_overrides(). Carries parameters_fresh and wsg_species_presence.

aoi

Character. AOI identifier — today a watershed group code (e.g. "BULK") matched against loaded$wsg_species_presence$watershed_group_code.

paused

Logical. Also count the species the bundle pauses. Default FALSE: the species classified.

Value

Character vector of species codes. Empty when neither config nor AOI carries species.

Details

The returned set is the intersection of:

  • cfg$species — species the rules YAML classifies (parsed at lnk_config() load time)

  • species flagged present for aoi in loaded$wsg_species_presence — the wide-form presence table where each species column (bt, ch, cm, ...) holds "t" for present and "f" for absent

When loaded$wsg_species_presence is not populated the function returns cfg$species unfiltered. When the AOI is not found in the table the function returns character(0).

A species the bundle pauses (cfg$species_paused, from its species_modelled.csv) is not classified, so it is left out unless paused = TRUE. That form answers whether a group is modelled at all: a group where only paused species are present is still built for its segments and barriers, which other groups' access reads, and gets no habitat.

Examples

cfg    <- lnk_config("bcfishpass")
loaded <- lnk_load_overrides(cfg)
lnk_pipeline_species(cfg, loaded, "BULK")
#> [1] "BT" "CH" "CO" "PK" "SK" "ST"

# default pauses KO and RB: MURT is modelled, with nothing to classify
cfg <- lnk_config("default")
loaded <- lnk_load_overrides(cfg)
lnk_pipeline_species(cfg, loaded, "MURT")
#> character(0)
lnk_pipeline_species(cfg, loaded, "MURT", paused = TRUE)
#> [1] "RB"
lnk_pipeline_species(cfg, loaded, "ADMS")
#> [1] "BT" "CH" "CO" "PK" "SK"