Skip to content

lnk_habitat_validate() scores mad watershed groups as if they were cw #299

Description

@NewGraphEnvironment

If done: observation validation reports the right miss reasons for groups a bundle
puts on discharge. If never: a mad group's "missed for width" counts are computed
against channel width the classification never used. Nothing is affected until a
bundle actually sets a group to mad, and none does today.

Since #286, lnk_pipeline_classify() passes the bundle's
parameters_habitat_method.csv to fresh, and a mad group classifies on mad_m3s.
lnk_habitat_validate() still builds its predicates with
fresh::frs_habitat_predicates(spp), which is the cw model
(R/lnk_habitat_validate.R:823). It then relaxes width by rewriting s.channel_width
(.lnk_hv_relax(), :772-786), with minimums taken from
ranges$<stage>$channel_width (.lnk_hv_stage_min(), :763). On a mad group:

fresh >= 0.35.0 has frs_habitat_predicates(model = "mad"). Resolve each scored
group's model from the bundle's method table, build the predicates per model, and relax
s.mad_m3s for mad groups. test-lnk_habitat_validate.R "the predicate call stays on
the channel-width model" pins today's behaviour and should change with it.

As landed (#301)

  • Each scored group's model comes from the cfg method table, resolved by fresh's .frs_habitat_models(), now shared with classify. mad_m3s is joined from the discharge table on linear_feature_id, as proposed.
  • Labels kept (decision at the plan gate): fails_width / width_null mean the group's size dimension. observations gains model and mad_m3s, and summary gains model, so a reader can split them.
  • New reason no_mad_threshold (not in the original proposal): a mad miss that a MAD range alone would admit, for BT, GR, KO and RB, which have none. Tuning and adding those thresholds is Tune MAD (discharge) thresholds for BT, GR, KO and RB rather than leave them missing #302.
  • The stream-order bypass needed no change: the validator never credits it on either model.
  • Live check on ADMS: cw output is unchanged; on mad, main had labelled 27 BT rearing misses post_predicate (data-raw/logs/habitat_validate_299/).

Activity

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