Skip to content

Codebook-driven criteria, color, and colormap parsing with MLflow tracking#30

Merged
rcjackson merged 1 commit into
ARM-Development:mainfrom
rcjackson:codebook-parsing
Jul 13, 2026
Merged

Codebook-driven criteria, color, and colormap parsing with MLflow tracking#30
rcjackson merged 1 commit into
ARM-Development:mainfrom
rcjackson:codebook-parsing

Conversation

@rcjackson

Copy link
Copy Markdown
Collaborator

Summary

Parse machine-enforceable rules directly from the LARS codebook so labelling stays in sync with the annotator-facing spec, and add MLflow run tracking.

  • criteria_from_codebook — extract hard pct_gates_* / n_gates_* dBZ thresholds and reclassification targets from category descriptions.
  • color_criteria_from_codebook (+ COLOR_DBZ_RANGE) — derive color presence/absence/exclusivity/dominance rules for validation.
  • colormap_from_codebook — read the Section 2.2 color-scale spec (colormap name, vmin, vmax). label_radar_data now sources vmin/vmax from the codebook when a codebook_path is provided, falling back to DEFAULT_VMIN (-20) / DEFAULT_VMAX (60).
  • apply_criteria_to_labels — override LLM labels that violate codebook criteria, recording the original label and the rule that fired.
  • tracking.py — log params, validation metrics, and a codebook hash to MLflow for traceability.
  • Tests — cover the codebook parsers (categories/criteria/color/colormap) and validation-metric computation.

Motivation

The codebook's Section 2.2 color scale (ChaseSpectral, vmin=-10, vmax=60) and the quantitative reclassification rules in each class description were previously only human-readable. This ingests them so the same spec drives inference and validation.

Test plan

  • pytest tests/test_validation_tracking.py — 12 passed.

🤖 Generated with Claude Code

…w tracking

Parse machine-enforceable rules directly from the LARS codebook so labelling
stays in sync with the annotator-facing spec:

- criteria_from_codebook: extract hard pct/n_gates dBZ thresholds and
  reclassification targets from category descriptions.
- color_criteria_from_codebook + COLOR_DBZ_RANGE: derive color
  presence/absence/exclusivity/dominance rules for validation.
- colormap_from_codebook: read the Section 2.2 color-scale spec
  (colormap name, vmin, vmax); label_radar_data now sources vmin/vmax
  from the codebook when a codebook_path is given, falling back to
  DEFAULT_VMIN (-20) / DEFAULT_VMAX (60).
- apply_criteria_to_labels: override LLM labels that violate codebook
  criteria, recording the original label and the rule that fired.
- tracking.py: log runs, validation metrics, and a codebook hash to MLflow.
- tests: cover the codebook parsers and validation metrics.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rcjackson rcjackson merged commit e021979 into ARM-Development:main Jul 13, 2026
4 checks passed
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