Skip to content

feat: Enhance config validation (Resolves #33)#42

Open
dyrpsf wants to merge 1 commit into
draeger-lab:devfrom
dyrpsf:feature/issue-33-config-validation
Open

feat: Enhance config validation (Resolves #33)#42
dyrpsf wants to merge 1 commit into
draeger-lab:devfrom
dyrpsf:feature/issue-33-config-validation

Conversation

@dyrpsf

@dyrpsf dyrpsf commented Jul 13, 2026

Copy link
Copy Markdown

Description

This PR introduces a robust, dictionary-based configuration validation system to resolve Issue #33. It centralizes the validation logic into a new config_validator.py utility, replacing the previously verbose YAML traversal[cite: 2].

Key Changes

  • Centralized Schema Validation: Created SchemaField and validate_config to allow developers to define expected configuration structures cleanly.
  • Deprecated Keyword Handling:
    • Replaced the USER -> None fallback with a system that warns the user and automatically applies sensible developer-defined defaults[cite: 2].
    • The _USER_ keyword now throws an explicit ConfigValidationError for missing required parameters[cite: 2].
  • Input Correctness: Added built-in support to check if numerical inputs are within specific ranges (min_val/max_val) and if string parameters match an expected list (allowed_values)[cite: 2].
  • Path Verification: Added is_path and path_must_exist flags to strictly verify that provided file/directory paths actually exist on the system[cite: 2].

Testing

Tested locally to ensure accurate error throwing for missing parameters and out-of-bound variables, as well as successful fallbacks for deprecated keywords.

Resolves draeger-lab#33. Replaces verbose YAML traversal and USER/_USER_ keyword logic with a recursive dictionary schema validator. Adds support for type enforcement, range checking, path validation, and sensible defaults.
@dyrpsf
dyrpsf changed the base branch from main to dev July 16, 2026 11:29
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