Skip to content

Scenario specification schema and validation for CARB HSP scenarios - #4

Open
divine7022 wants to merge 6 commits into
management_pracfrom
scenario-config
Open

Scenario specification schema and validation for CARB HSP scenarios#4
divine7022 wants to merge 6 commits into
management_pracfrom
scenario-config

Conversation

@divine7022

@divine7022 divine7022 commented Feb 3, 2026

Copy link
Copy Markdown

Adds the ability for CARB staff to define management scenarios as YAML configuration files. This is the front-end specification layer that sits between policy decisions and model inputs.

A scenario file lets you say things like "Fresno County will have 5000 acres of compost by 2030, growing to 15000 by 2045" - and the system handles the rest.

  • scenario_schema.yaml - Formal definition of what goes in a scenario file. Includes all 31 HSP practices from the 2026 Practice Guidelines.
  • validate_scenario.R - Checks that scenario files are valid before we try to use them. Catches mistakes like using the wrong practice for a crop type.
  • scenario_to_boolean.R - Converts county-level targets into field-level assignments (which specific fields get which practices)
  • scenario_to_events.R - Generates the events.json files that SIPNET actually consumes

Examples and docs (examples/scenario_bau.yaml, examples/scenario_hsp_high.yaml and docs/scenario_specification.md)

  • Two example scenarios (BAU baseline and high-adoption alternative)
  • User documentation explaining how to write scenario files

Details

Practices covered: All 31 from HSP 2026 Guidelines including the new ones (biochar, delta rice). Complete list with eligibility rules and NRCS codes.

Validation checks:

  • Required fields present
  • County names spelled correctly (all 58 CA counties)
  • Practices eligible for the specified crop type
  • Incompatible practices not combined (e.g., no-till + reduced-till)
  • Trajectory values non-negative and sensible

county: alias: Added support for using county: Fresno instead of area: Fresno when working with the california_counties domain. Minor convenience that matches how people naturally think about it.

TODO

  • Climate scenarios (GCM × SSP) - those come from Cal-Adapt, separate data pipeline
  • Transition matrices for field-level dynamics - that's #160
  • Integration with the actual downscaling runs - needs field data

Implements: ccmmf/organization#171

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