Coverage for /usr/lib/python3/dist-packages/sympy/polys/matrices/exceptions.py: 100%
21 statements
« prev ^ index » next coverage.py v7.9.1, created at 2025-06-14 15:55 +0200
« prev ^ index » next coverage.py v7.9.1, created at 2025-06-14 15:55 +0200
1"""
3Module to define exceptions to be used in sympy.polys.matrices modules and
4classes.
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.
10"""
13class DMError(Exception):
14 """Base class for errors raised by DomainMatrix"""
15 pass
18class DMBadInputError(DMError):
19 """list of lists is inconsistent with shape"""
20 pass
23class DMDomainError(DMError):
24 """domains do not match"""
25 pass
28class DMNotAField(DMDomainError):
29 """domain is not a field"""
30 pass
33class DMFormatError(DMError):
34 """mixed dense/sparse not supported"""
35 pass
38class DMNonInvertibleMatrixError(DMError):
39 """The matrix in not invertible"""
40 pass
43class DMRankError(DMError):
44 """matrix does not have expected rank"""
45 pass
48class DMShapeError(DMError):
49 """shapes are inconsistent"""
50 pass
53class DMNonSquareMatrixError(DMShapeError):
54 """The matrix is not square"""
55 pass
58class DMValueError(DMError):
59 """The value passed is invalid"""
60 pass
63__all__ = [
64 'DMError', 'DMBadInputError', 'DMDomainError', 'DMFormatError',
65 'DMRankError', 'DMShapeError', 'DMNotAField',
66 'DMNonInvertibleMatrixError', 'DMNonSquareMatrixError', 'DMValueError'
67]