Skip to content

Input validation - #143

Open
AdhocMan wants to merge 4 commits into
epfl-radio-astro:mainfrom
AdhocMan:input_validation_2
Open

Input validation#143
AdhocMan wants to merge 4 commits into
epfl-radio-astro:mainfrom
AdhocMan:input_validation_2

Conversation

@AdhocMan

@AdhocMan AdhocMan commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Replace the packaged base config (tabascal/data/config/tab_config_base.yaml) and its
deep_update merge with a declarative schema. Every parameter is declared as a Param on
the class that reads it — components in their own config_params, everything else on
TabConfig — so a component and its requirements cannot drift apart, and there is no second
copy of the key names to keep in sync.

What this changes

  • New tabascal/config_schema.py: Param, collect_params, validate_config, and a
    ConfigError. Validation runs before the Measurement Set is read or any TLEs are fetched,
    applies defaults, and collects every problem into one report (with difflib suggestions
    for misspelled keys) instead of failing on the first one.
  • Schema is per-run: only the components named in model.components contribute, so a key
    belonging to an unselected component is reported as such rather than silently ignored.
  • New tabascal check-config -c <file> subcommand: validates a config and prints the
    resolved model and the fully defaulted configuration, without running anything.
  • Data-derived defaults: parameters marked FROM_DATA (correlation lengths, noise, dish
    diameter) stay unresolved until setup. axis_extent in components/__init__.py gives a
    single-sample axis its sample spacing instead of a zero length scale.
  • CI: SLURM_TIMELIMIT is now applied per job via a YAML anchor. Set globally it was
    overridden by the job-level value the CSCS .container-runner-* templates inherit, leaving
    every job on the template's 15 minutes.
  • Docs and examples: docs/config.md rewritten around the declared parameters,
    docs/usage.md documents check-config, and the example/test configs drop keys that no
    longer exist.

Tests

tests/test_config_schema.py (new) covers type/range checking, unknown and missing keys,
component-scoped parameters, and multi-problem reporting; test_run_cli.py covers the new
subcommand. Gains and RFI signal tests updated for the resolved-config path.

@read-the-docs-community

read-the-docs-community Bot commented Aug 17, 2026

Copy link
Copy Markdown

Documentation build overview

📚 tabascal | 🛠️ Build #34100732 | 📁 Comparing 041c33a against latest (8e80788)

  🔍 Preview build  

15 files changed · ± 14 modified · - 1 deleted

± Modified

- Deleted

@AdhocMan
AdhocMan marked this pull request as ready for review August 17, 2026 12:00
@AdhocMan
AdhocMan requested a review from chrisfinlay August 17, 2026 12:01
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