jdxi_editor.ui.editors.validation ================================= .. py:module:: jdxi_editor.ui.editors.validation .. autoapi-nested-parse:: Validation utilities for editor sections. This module provides validation functions to ensure editor sections are configured correctly, preventing bugs like using FILTER parameters in AMP sections or vice versa. Usage: # Run validation directly python jdxi_editor/ui/editors/validation.py # Or run the unit tests python -m unittest tests.test_editor_validation # Or use in code from jdxi_editor.ui.editors.validation import validate_digital_sections errors = validate_digital_sections() if errors: # Handle validation errors Attributes ---------- .. autoapisummary:: jdxi_editor.ui.editors.validation.project_root Functions --------- .. autoapisummary:: jdxi_editor.ui.editors.validation.validate_adsr_spec jdxi_editor.ui.editors.validation.validate_section_parameters jdxi_editor.ui.editors.validation.validate_digital_sections Module Contents --------------- .. py:function:: validate_adsr_spec(section_name: str, adsr_spec: Dict[jdxi_editor.ui.adsr.spec.ADSRStage, jdxi_editor.ui.adsr.spec.ADSRSpec], expected_prefix: str) -> List[str] Validate that spec_adsr uses parameters with the expected prefix. :param section_name: Name of the section being validated (e.g., "DigitalAmpSection") :param adsr_spec: The spec_adsr dictionary to validate :param expected_prefix: Expected parameter prefix (e.g., "AMP_ENV", "FILTER_ENV") :returns: List of error messages (empty if validation passes) .. py:function:: validate_section_parameters(section_name: str, param_specs: List, expected_prefixes: Set[str]) -> List[str] Validate that parameter specs (e.g. SLIDER_GROUPS['controls']) use parameters with expected prefixes. :param section_name: Name of the section being validated :param param_specs: List of SliderSpec/SwitchSpec/ComboBoxSpec objects :param expected_prefixes: Set of allowed parameter name prefixes :returns: List of error messages (empty if validation passes) .. py:function:: validate_digital_sections() -> Dict[str, List[str]] Validate all digital editor sections for correct parameter usage. :returns: Dictionary mapping section names to lists of error messages .. py:data:: project_root