mbdlyb.messages =============== .. py:module:: mbdlyb.messages .. autoapi-nested-parse:: Message classes for model validation and diagnostics. Provides classes for representing validation issues, errors, and warnings during model creation and analysis. Classes ------- .. autoapisummary:: mbdlyb.messages.Error mbdlyb.messages.ValidationMessage mbdlyb.messages.Warning Module Contents --------------- .. py:class:: Error(message: str, fix_label: Optional[str] = None, object_to_fix: Optional[object] = None) Bases: :py:obj:`ValidationMessage` High-priority validation error message. Indicates a critical issue that must be resolved for the model to be valid. .. py:attribute:: COLOR :value: 'error' .. py:attribute:: PRIORITY :value: 2 .. py:class:: ValidationMessage(message: str, fix_label: Optional[str] = None, object_to_fix: Optional[object] = None) Base class for validation messages reported during model analysis. ValidationMessage represents an issue found during model validation with an optional suggestion for fixing it. Messages can be sorted by priority and include references to the model object that needs attention. :ivar PRIORITY: Class-level priority for sorting (lower is more urgent). :vartype PRIORITY: int :ivar COLOR: Color code for UI representation (e.g., 'error', 'warning'). :vartype COLOR: str :ivar message: The validation message text. :vartype message: str :ivar fix_label: Label describing the suggested fix. :vartype fix_label: Optional[str] :ivar object_to_fix: Reference to the model object needing attention. :vartype object_to_fix: Optional[object] .. py:attribute:: COLOR :type: str .. py:attribute:: PRIORITY :type: int .. py:property:: color :type: str Get the color code for UI representation. :returns: Color identifier (e.g., 'error', 'warning'). :rtype: str .. py:attribute:: fix_label :type: Optional[str] .. py:property:: has_object_to_fix :type: bool Check if this message includes a fixable object reference. :returns: True if both fix_label and object_to_fix are present. :rtype: bool .. py:attribute:: message :type: str .. py:attribute:: object_to_fix :type: Optional[object] .. py:property:: priority :type: int Get the priority level for this message. :returns: Lower values indicate higher priority (more urgent). :rtype: int .. py:class:: Warning(message: str, fix_label: Optional[str] = None, object_to_fix: Optional[object] = None) Bases: :py:obj:`ValidationMessage` Lower-priority validation warning message. Indicates a potential issue that should be reviewed but may not prevent model usage. .. py:attribute:: COLOR :value: 'warning' .. py:attribute:: PRIORITY :value: 4