imas_validator.rules.data.IDSValidationRule

class imas_validator.rules.data.IDSValidationRule(rule_path: Path, func: Callable, *ids_names: str, version: str = '', **kwfields: dict[str, Any])

Bases: object

Object holding the validation rule function and other relevant data

__init__(rule_path: Path, func: Callable, *ids_names: str, version: str = '', **kwfields: dict[str, Any])

Initialize IDSValidationRule

Parameters:
rule_path: Path

Path to file where the rule is defined

func: Callable

Function that defines validation rules

*ids_names: str

Names of ids instances to be validated

**kwfields: dict[str, Any]

keyword arguments to be inputted in the validation function

Methods

__init__(rule_path, func, *ids_names[, version])

Initialize IDSValidationRule

apply_func(ids_instances)

Run the validation function with wrapped input arguments

parse_ids_names(*ids_names)

Extract ids names and occurrences from ids_names input

apply_func(ids_instances: list[IDSToplevel]) None

Run the validation function with wrapped input arguments

Parameters:
ids_instances: list[IDSToplevel]

ids instances to be validated

parse_ids_names(*ids_names: str) tuple[tuple[str, ...], tuple[int | None, ...]]

Extract ids names and occurrences from ids_names input

Parameters:
*ids_names: str

Names of ids instances to be validated

Returns:

Parsed IDS names and occurrence numbers.


Last update: 2025-08-29