1"""
2
3Module to define exceptions to be used in sympy.polys.matrices modules and
4classes.
5
6Ideally all exceptions raised in these modules would be defined and documented
7here and not e.g. imported from matrices. Also ideally generic exceptions like
8ValueError/TypeError would not be raised anywhere.
9
10"""
11
12from sympy.matrices.common import (NonInvertibleMatrixError,
13    NonSquareMatrixError, ShapeError)
14
15
16class DDMError(Exception):
17    """Base class for errors raised by DDM"""
18    pass
19
20
21class DDMBadInputError(DDMError):
22    """list of lists is inconsistent with shape"""
23    pass
24
25
26class DDMDomainError(DDMError):
27    """domains do not match"""
28    pass
29
30
31class DDMShapeError(DDMError):
32    """shapes are inconsistent"""
33    pass
34
35
36class DDMFormatError(DDMError):
37    """mixed dense/sparse not supported"""
38    pass
39
40
41__all__ = [
42    'DDMError', 'DDMShapeError', 'DDMDomainError', 'DDMFormatError',
43
44    'NonSquareMatrixError', 'NonInvertibleMatrixError', 'ShapeError',
45]
46