imas_validator.validate.result_collector.ResultCollector

class imas_validator.validate.result_collector.ResultCollector(validate_options: ValidateOptions, imas_uri: str)

Bases: object

Class for storing IDSValidationResult objects

__init__(validate_options: ValidateOptions, imas_uri: str)

Initialize ResultCollector

Parameters:
validate_options: ValidateOptions

Dataclass for validate options

Methods

__init__(validate_options, imas_uri)

Initialize ResultCollector

add_error_result(exc)

Add result after an exception was encountered in the rule

append_nodes_dict(nodes_dict, idss)

Add touched nodes and filled nodes to nodes_dicts during assert

assert_(test[, msg])

Custom assert function with which to overwrite assert statements in IDS validation tests

coverage_dict()

Return a dictionary of IDSs showing how many nodes per IDS are covered in different categories

create_nodes_dict(ids_nodes)

Create dict with list of touched nodes for the IDSValidationResult object

result_collection()

Return object detailing the final results of validation process

set_context(rule, idss)

Set which rule and IDSs should be stored in results

add_error_result(exc: Exception) None

Add result after an exception was encountered in the rule

Parameters:
exc: Exception

Exception that was encountered while running validation test

append_nodes_dict(nodes_dict: dict[tuple[str, int], set[str]], idss: list[tuple[IDSToplevel, str, int]]) None

Add touched nodes and filled nodes to nodes_dicts during assert

Parameters:
nodes_dict: dict[tuple[str, int], set[str]]

dict of touched nodes during validation process

idss: list[tuple[IDSToplevel, str, int]]

Tuple of ids_instances, ids_names and occurrences

assert_(test: Any, msg: str = '') None

Custom assert function with which to overwrite assert statements in IDS validation tests

Parameters:
test: Any

Expression to evaluate in test

msg: str = ''

Given message for failed assertion

coverage_dict() dict[tuple[str, int], CoverageMap]

Return a dictionary of IDSs showing how many nodes per IDS are covered in different categories

create_nodes_dict(ids_nodes: list[IDSPrimitive]) dict[tuple[str, int], set[str]]

Create dict with list of touched nodes for the IDSValidationResult object

Parameters:
ids_nodes: list[IDSPrimitive]

List of IDSPrimitive nodes that have been touched in this test

result_collection() IDSValidationResultCollection

Return object detailing the final results of validation process

set_context(rule: IDSValidationRule, idss: list[tuple[IDSToplevel, str, int]]) None

Set which rule and IDSs should be stored in results

Parameters:
rule: IDSValidationRule

Rule to apply to IDS data

idss: list[tuple[IDSToplevel, str, int]]

Tuple of ids_instances, ids_names and occurrences


Last update: 2025-06-05