Skip to content

Add wetland_rearing column to frs_habitat_classify output#164

Merged
NewGraphEnvironment merged 1 commit intomainfrom
add-wetland-rearing-column
Apr 24, 2026
Merged

Add wetland_rearing column to frs_habitat_classify output#164
NewGraphEnvironment merged 1 commit intomainfrom
add-wetland-rearing-column

Conversation

@NewGraphEnvironment
Copy link
Copy Markdown
Owner

Summary

Adds a wetland_rearing boolean column to frs_habitat_classify()'s output schema, mirroring the existing lake_rearing pattern joined to fwa_wetlands_poly instead of fwa_lakes_poly. Prerequisite for link-side work that needs to distinguish wetland-based from lake-based rearing in compound rollups (see link#51).

Changes

  • R/frs_habitat_classify.R
    • Output schema gains wetland_rearing boolean alongside lake_rearing.
    • New wetland_rear_cond mirroring lake_rear_cond — same per-species rear channel-width window, joined to whse_basemapping.fwa_wetlands_poly on waterbody_key.
    • INSERT extended to populate the new column.
    • Docstring updated to list wetland_rearing in the output schema; example SELECT extended.
  • man/frs_habitat_classify.Rd regenerated.

Per-species opt-in via rules YAML / dimensions.csv lands on top of this column in a follow-up — this PR is just the raw "segment is a wetland under the species' rear channel-width window" flag. Any species whose rear channel_width range matches today gets wetland_rearing evaluated the same way they get lake_rearing evaluated today.

Test plan

  • devtools::test(filter = "frs_habitat_classify") on M1 — 41 PASS, 0 FAIL.
  • Full devtools::test() on M4 (full-suite rerun scheduled separately; dispatched but slow on M1, not blocking).

No behaviour change for existing callers — lake_rearing semantics unchanged. wetland_rearing is a net-new column that defaults to FALSE for any species whose rear channel_width range doesn't include wetland-classified segments.

Bumps fresh to 0.16.0 (additive schema change).

Relates to link#51.

Mirrors the lake_rearing pattern, joined to fwa_wetlands_poly instead
of fwa_lakes_poly. Lets callers distinguish wetland-based rearing
habitat from lake-based rearing in per-segment boolean form — needed
so downstream rollup layers can report lake_rearing_ha and
wetland_rearing_ha as separate compound rollup columns.

Per-species opt-in via rules YAML / dimensions.csv lands on top of
this column. This is just the raw 'segment is a wetland under the
species rear channel-width window' flag — any species whose rear
channel_width range matches will get wetland_rearing evaluated the
same way they get lake_rearing evaluated today.

Prereq for link#51 (default config with compound rollup).
@NewGraphEnvironment NewGraphEnvironment merged commit fc74f63 into main Apr 24, 2026
1 check passed
@NewGraphEnvironment NewGraphEnvironment deleted the add-wetland-rearing-column branch April 24, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant