Skip to content

Support baselines in runs and make baseline_id optional#121

Open
dnerini wants to merge 1 commit intomainfrom
codex/update-config-structure-for-joint-runs
Open

Support baselines in runs and make baseline_id optional#121
dnerini wants to merge 1 commit intomainfrom
codex/update-config-structure-for-joint-runs

Conversation

@dnerini
Copy link
Member

@dnerini dnerini commented Mar 18, 2026

Motivation

  • Allow baseline entries to be defined inline in the runs list (alongside forecasters and interpolators) and simplify baseline configuration by making baseline_id optional.
  • Preserve backward compatibility with the legacy top-level baselines block while encouraging the new inline format.

Description

  • Update the Pydantic model so BaselineConfig.baseline_id is optional (str | None) and its description documents that it defaults to the label when omitted.
  • Extend ConfigModel.runs to accept BaselineItem entries and mark the top-level baselines list as deprecated with a default empty list.
  • Update the JSON schema (workflow/tools/config.schema.json) to reflect the nullable baseline_id, allow BaselineItem in runs, and remove the requirement for the legacy top-level baselines field.
  • Modify Snakemake helper workflow/rules/common.smk so baseline entries in config['runs'] are ignored by collect_all_runs, collected by collect_all_baselines (using baseline_id fallback to label), and legacy top-level baselines remain supported.
  • Adjust example configs to remove the old top-level baselines block where applicable and add/maintain inline baseline entries.
  • Add unit tests to validate backward compatibility and correct workflow parsing: test_legacy_top_level_baselines_still_supported and test_workflow_parsing_excludes_baselines_from_run_configs.

Testing

  • Ran the updated unit tests (pytest tests/unit/test_config.py) focusing on config validation and workflow parsing, and all tests passed.
  • Verified the two new tests test_legacy_top_level_baselines_still_supported and test_workflow_parsing_excludes_baselines_from_run_configs succeed.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant