paroto.validation.arc002 ======================== .. py:module:: paroto.validation.arc002 .. autoapi-nested-parse:: ARC002 parameter registry validation utilities. This module provides utilities to validate OpenMDAO Problems against the ARC002 parameter registry, ensuring consistent naming and correct system associations. Classes ------- .. autoapisummary:: paroto.validation.arc002.ARC002Registry Functions --------- .. autoapisummary:: paroto.validation.arc002.extract_problem_variable_names paroto.validation.arc002.check_vedef_problem_compatibility Module Contents --------------- .. py:class:: ARC002Registry(registry_path = None) ARC002 parameter registry loader and validator. .. attribute:: registry_path Path to the ARC002 parameter registry CSV file :type: :py:class:`Path` .. attribute:: df Loaded parameter registry data :type: :py:class:`pd.DataFrame` .. attribute:: tags_to_equipment Mapping from Parameter_Tag to Equipment_Class :type: :py:class:`Dict[str`, :py:class:`str]` .. attribute:: tags_to_description Mapping from Parameter_Tag to Parameter description :type: :py:class:`Dict[str`, :py:class:`str]` .. attribute:: tags_to_units Mapping from Parameter_Tag to Units :type: :py:class:`Dict[str`, :py:class:`str]` .. py:attribute:: registry_path .. py:attribute:: df :value: None .. py:attribute:: tags_to_equipment .. py:attribute:: tags_to_description .. py:attribute:: tags_to_units .. py:method:: is_valid_tag(tag) Check if a parameter tag is defined in ARC002 registry. :param tag: Parameter tag to check :type tag: :py:class:`str` :returns: True if tag exists in registry :rtype: :py:class:`bool` .. py:method:: get_equipment_class(tag) Get the Equipment_Class for a given parameter tag. :param tag: Parameter tag :type tag: :py:class:`str` :returns: Equipment_Class if tag exists, None otherwise :rtype: :py:class:`str` or :py:obj:`None` .. py:method:: get_description(tag) Get the parameter description for a given tag. :param tag: Parameter tag :type tag: :py:class:`str` :returns: Parameter description if tag exists, None otherwise :rtype: :py:class:`str` or :py:obj:`None` .. py:method:: get_units(tag) Get the units for a given parameter tag. :param tag: Parameter tag :type tag: :py:class:`str` :returns: Units if tag exists, None otherwise :rtype: :py:class:`str` or :py:obj:`None` .. py:method:: get_tags_for_equipment(equipment_class) Get all parameter tags for a given Equipment_Class. :param equipment_class: Equipment class name (e.g., 'Generator', 'PlasmaTorch') :type equipment_class: :py:class:`str` :returns: List of parameter tags for this equipment class :rtype: :py:class:`List[str]` .. py:method:: validate_problem_parameters(problem_vars, expected_systems = None) Validate problem variable names against ARC002 registry. :param problem_vars: List of variable names from an OpenMDAO Problem :type problem_vars: :py:class:`List[str]` :param expected_systems: Mapping of parameter tag to expected Equipment_Class. If provided, validates that tags match expected systems. :type expected_systems: :py:class:`Dict[str`, :py:class:`str]`, *optional* :returns: * **valid** (:py:class:`List[str]`) -- Valid parameter tags found in registry * **invalid** (:py:class:`List[str]`) -- Parameter names not found in registry * **mismatched** (:py:class:`List[str]`) -- Parameter tags that belong to wrong Equipment_Class (only if expected_systems provided) .. py:method:: print_validation_report(problem_vars, expected_systems = None) Print a formatted validation report. :param problem_vars: List of variable names from an OpenMDAO Problem :type problem_vars: :py:class:`List[str]` :param expected_systems: Mapping of parameter tag to expected Equipment_Class :type expected_systems: :py:class:`Dict[str`, :py:class:`str]`, *optional* .. py:function:: extract_problem_variable_names(prob) Extract all variable names from an OpenMDAO Problem. :param prob: OpenMDAO problem instance :type prob: :py:class:`openmdao.api.Problem` :returns: List of variable names (inputs and outputs) :rtype: :py:class:`List[str]` .. py:function:: check_vedef_problem_compatibility(prob) Check VedEf problem compatibility with ARC002 registry. :param prob: VedEf problem instance :type prob: :py:class:`openmdao.api.Problem` :returns: True if all critical parameters are ARC002-compliant :rtype: :py:class:`bool`