Coverage for /home/martinb/.local/share/virtualenvs/camcops/lib/python3.6/site-packages/statsmodels/tools/sm_exceptions.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""
2Contains custom errors and warnings.
4Errors should derive from Exception or another custom error. Custom errors are
5only needed it standard errors, for example ValueError or TypeError, are not
6accurate descriptions of the reason for the error.
8Warnings should derive from either an existing warning or another custom
9warning, and should usually be accompanied by a sting using the format
10warning_name_doc that services as a generic message to use when the warning is
11raised.
12"""
14import warnings
17# Errors
18class PerfectSeparationError(Exception):
19 pass
22class MissingDataError(Exception):
23 pass
26class X13NotFoundError(Exception):
27 pass
30class X13Error(Exception):
31 pass
34# Warning
35class X13Warning(Warning):
36 pass
39class IOWarning(RuntimeWarning):
40 pass
43class ModuleUnavailableWarning(Warning):
44 pass
47module_unavailable_doc = """
48The module {0} is not available. Cannot run in parallel.
49"""
52class ModelWarning(UserWarning):
53 pass
56class ConvergenceWarning(ModelWarning):
57 pass
60convergence_doc = """
61Failed to converge on a solution.
62"""
65class CacheWriteWarning(ModelWarning):
66 pass
69class IterationLimitWarning(ModelWarning):
70 pass
73iteration_limit_doc = """
74Maximum iteration reached.
75"""
78class InvalidTestWarning(ModelWarning):
79 pass
82class NotImplementedWarning(ModelWarning):
83 pass
86class OutputWarning(ModelWarning):
87 pass
90class DomainWarning(ModelWarning):
91 pass
94class ValueWarning(ModelWarning):
95 pass
98class EstimationWarning(ModelWarning):
99 pass
102class SingularMatrixWarning(ModelWarning):
103 pass
106class HypothesisTestWarning(ModelWarning):
107 pass
110class InterpolationWarning(ModelWarning):
111 pass
114class PrecisionWarning(ModelWarning):
115 pass
118class SpecificationWarning(ModelWarning):
119 pass
122class HessianInversionWarning(ModelWarning):
123 pass
126class CollinearityWarning(ModelWarning):
127 pass
130recarray_warning = """\
131recarray support has been deprecated and will be removed after 0.12. Please \
132use pandas DataFrames and Series for structured data.
134You can suppress this warning using
136from warnings import filterwarnings
137filterwarnings("ignore", message="recarray support", category=FutureWarning)
138"""
141warnings.simplefilter('always', category=ModelWarning)
142warnings.simplefilter("always", (ConvergenceWarning, CacheWriteWarning,
143 IterationLimitWarning, InvalidTestWarning))