warnings
warnings
Warning collection and management for scenarios.
Classes
ModelWarning
dataclass
Individual warning with context and metadata.
Functions
to_dict
Convert to dictionary for serialization.
WarningCollector
Manages warnings for a model instance with a clean API.
Source code in src/pyetm/models/warnings.py
Functions
with_warning
classmethod
Convenience method to create a WarningCollector with a single warning.
Source code in src/pyetm/models/warnings.py
add
Add warning(s) to the collection.
Source code in src/pyetm/models/warnings.py
clear
Clear warnings. If field is specified, clear only that field.
get_by_field
has_warnings
Check if warnings exist. If field specified, check only that field.
get_fields_with_warnings
to_dict
Convert to dictionary grouped by field.
Source code in src/pyetm/models/warnings.py
merge_from
Merge warnings from another collector, optionally with a field prefix.
Source code in src/pyetm/models/warnings.py
merge_submodel_warnings
Merge warnings from Base model instances.
Source code in src/pyetm/models/warnings.py
show_warnings
Print all warnings to console in a readable format.
Source code in src/pyetm/models/warnings.py
__len__
__bool__
__iter__
__repr__
Nice string representation showing warning summary.