Skip to content

NZB: scenario_config CSV + setScenario single-run launcher - #5

Merged
alexkoberle merged 1 commit into
emis_cap_regfrom
nzb-scenario-csv
Jul 6, 2026
Merged

NZB: scenario_config CSV + setScenario single-run launcher#5
alexkoberle merged 1 commit into
emis_cap_regfrom
nzb-scenario-csv

Conversation

@flohump

@flohump flohump commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #4 (merged). Adds a CSV-driven way to launch the NZB policy families, so scenario selection doesn't require editing R — the basis for the automated platform.

Added

  • config/scenario_config_nzb.csv — FSEC-style base+delta registry: a nzb_base column of common settings + 7 family columns (gC_wdpa, gC_30by30, gC_half, gA_RoW2C, gB_price, gF_freeze, g0_npi), each holding only its deltas (MACC profile, conservation, CO₂ price, bioenergy split, export-freeze list).
  • scripts/start/nzb_launch.R — launches one family via gms::setScenario (base+delta overlay, the FSEC idiom), then enables the parametric cap from either:
    • NZB_TARGET — a reported-AFOLU 2050 target → cap = target + 63 (the reported↔cap offset), or
    • NZB_CAP — a raw s56_emis_cap_target value.

Notes

  • Same family definitions as nzb_export_grid.R; verified field-equivalent across all seven families.
  • setScenario splits comma cells into vectors, so columns are overlaid one at a time and the list-valued forcesuff21 switch is collapsed back to a single string after each overlay (a vector serialises fine to the GAMS set too; the collapse just avoids setScenario's scalar re-comparison error on the second column).
  • Run directly to skip start.R's renv update prompt:
    NZB_SCENARIO=gF_freeze NZB_TARGET=-100 Rscript scripts/start/nzb_launch.R
    

Add an FSEC-style base+delta scenario registry and a one-run launcher so the
NZB families can be driven from a CSV instead of R branching:

- config/scenario_config_nzb.csv: nzb_base + 7 family columns (gC_wdpa,
  gC_30by30, gC_half, gA_RoW2C, gB_price, gF_freeze, g0_npi), deltas only.
- scripts/start/nzb_launch.R: resolves nocc + nzb_base + one family via
  gms::setScenario (list-valued forcesuff21 collapsed back to a string after
  each overlay), and enables the parametric cap from either a reported-AFOLU
  target (cap = target + 63, the reported<->cap offset) or a raw cap value.

Same family definitions as nzb_export_grid.R; verified field-equivalent
across all seven.
@alexkoberle
alexkoberle merged commit 2a44cd1 into emis_cap_reg Jul 6, 2026
1 check 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.

2 participants