Skip to content

Habitat eligibility override CSV with edge_type and feature_code defaults #19

Closed

Description

@NewGraphEnvironment

Context

link ships an override CSV for parameters_habitat.csv that defines what qualifies as habitat per species. The override starts from bcfishpass v0.5.0 defaults and departs where biological rationale supports it. Each departure tracked as a separate issue.

fresh#100 (fresh 0.9.0) adds edge_type filtering, fresh#105 adds feature_code categories, fresh#102 exposes params so link can pass its own CSV. This issue is about the link-side override.

bcfishpass v0.5.0 defaults (edge_types)

Species spawn_edge_types rear_edge_types Notes
BT stream, canal No rearing edge filter. Rivers included via waterbody_type join.
CH stream, canal stream, canal Rivers via waterbody_type.
CM stream, canal No freshwater rearing.
CO stream, canal stream, canal CO wetland-flow carve-out (1050/1150). Rivers via waterbody_type.
PK stream, canal No freshwater rearing.
SK stream, canal Lake rearing via rear_lake_ha_min. No waterbody_type join.
ST stream, canal stream, canal Rivers via waterbody_type.
WCT stream, canal stream, canal Rivers via waterbody_type.

Note: bcfishpass v0.5.0 stream = 1000/1100 only (excludes 1050/1150 wetland-flow). fresh 0.9.0 stream category = 1000/1050/1100/1150. So fresh defaults already include wetland-flow streams.

bcfishpass v0.5.0 does not filter by feature_code.

Proposed link overrides

Edge types

Species spawn_edge_types rear_edge_types Diff from bcfishpass v0.5.0
BT stream, canal stream, canal, river, lake +river, +lake for rearing
CH stream, canal, river stream, canal, river, lake +river for spawning, +river/lake for rearing
CM stream, canal, river +river for spawning
CO stream, canal, river stream, canal, river, lake, wetland +river for spawning, +river/lake/wetland for rearing
PK stream, canal, river +river for spawning
SK stream, canal lake Explicit lake rearing via edge_type (alongside rear_lake_ha_min)
ST stream, canal, river stream, canal, river, lake +river for spawning, +river/lake for rearing
WCT stream, canal, river stream, canal, river, lake +river for spawning, +river/lake for rearing

Feature types

Species spawn_feature_types rear_feature_types Rationale
All stream_definite, stream_intermittent stream_definite, stream_intermittent, lake, reservoir Include intermittent — fish use seasonal streams for spawning/rearing. Exclude ditch, industrial.

Key departures requiring evidence (separate issues)

  1. Lakes for rearing (BT, CH, CO, ST, WCT) — bcfishpass v0.5.0 doesn't model lake rearing for most species. Many species rear in lakes (documented in Build fish passage connectivity literature RAG store #2 literature RAG).
  2. Intermittent streams included — bcfishpass v0.5.0 doesn't filter on feature_code so these are implicitly included. We're explicit about it.
  3. Wetland-flow streams for spawning — fresh 0.9.0 stream category includes 1050/1150. bcfishpass v0.5.0 excludes them. Streams through wetlands can be spawning habitat.
  4. Rivers for spawning — bcfishpass v0.5.0 includes via waterbody_type join. We include via edge_type category directly.
  5. Ditches excluded — not in any category. Fish may use ditches but we don't model them as habitat.

Implementation

Ship inst/extdata/parameters_habitat.csv as a complete override. Pass to fresh via:

frs_habitat(conn, "ADMS",
  params = frs_params(csv = system.file("extdata", "parameters_habitat.csv", package = "link")))

Relates to NewGraphEnvironment/fresh#100, NewGraphEnvironment/fresh#102, NewGraphEnvironment/fresh#105, #18

Activity

  1. NewGraphEnvironment commented on May 3, 2026

    @NewGraphEnvironment
    OwnerAuthor

    Closing — superseded by the current overrides infrastructure:

    • Per-species habitat eligibility lives in inst/extdata/configs/{bcfishpass,default}/dimensions.csv with the column-driven rule emission via lnk_rules_build(). The departures table in this issue (per-species edge_types) is now expressed via spawn_stream / rear_stream / rear_lake / rear_wetland columns + the edge_types / edge_types_explicit rule emission.
    • Known-habitat overlay is wired via user_habitat_classification.csv consumed by fresh::frs_habitat_overlay() in lnk_pipeline_classify().

    The "override CSV" framing has effectively become "the dimensions.csv + the overrides directory + the rules.yaml emission" together. Each named departure has its own column in dimensions.csv; the methodology research doc research/default_vs_bcfishpass.md documents the deltas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions