imas_validator.rules.data.ValidatorRegistry

class imas_validator.rules.data.ValidatorRegistry(rule_path: Path)

Bases: object

Example

@val_registry.validator('core_profiles')
def ids_rule(cp):
    assert cp != None
__init__(rule_path: Path)

Methods

__init__(rule_path)

validator(*ids_names[, version])

Decorator to register functions as validation rules

validator(*ids_names: str, version: str = '') Callable

Decorator to register functions as validation rules

The validation rule function will be called with the requested IDSs as arguments.

Parameters:
*ids_names: str

Names of ids instances to be validated, for example "core_profiles" or "pf_active". Use a wildcard "*" to accept any IDS. Add the occurrence number by appending the ids name with an integer >=0 like "summary:2". Occurrence number is required for multi-IDS validation.

Example

@validator("core_profiles")
def rule_for_core_profiles(cp):
    """Rule that applies to any core_profiles IDS."""
    ... # Write rules

@validator("*")
def rule_for_any_ids(ids):
    """Rule that applies to any IDS."""
    ... # Write rules

Last update: 2025-08-29