[docs]classAnalysisError(Exception):""" Analysis Error. This exception indicates that a possibly recoverable numerical error occurred in an analysis code or a subsolver. Parameters ---------- error : str Error message. location : None or inspect.currentframe() Inspect.currentframe of error being raised. msginfo : str Name of component that raise the AnalysisError. """
[docs]def__init__(self,error,location=None,msginfo=None):""" Initialize AnalysisError. """super().__init__(error)iflocationisnotNone:withreset_warning_registry():warnings.formatwarning=_warn_simple_formatmsg=(f"Analysis Error: {msginfo} Line {location.lineno} of file "f"{location.filename}")warnings.warn(msg,UserWarning,2)