• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

python-control / python-control / 13406527901

19 Feb 2025 06:12AM UTC coverage: 94.744%. Remained the same
13406527901

push

github

web-flow
Merge pull request #1127 from roryyorke/lint-tests

Lint tests

9861 of 10408 relevant lines covered (94.74%)

8.29 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
control/exception.py
1
# exception.py - exception definitions for the control package
2
#
3
# Initial author: Richard M. Murray
4
# Creation date: 31 May 2010
5

6
"""Exception definitions for the control package."""
7

8
class ControlSlycot(ImportError):
9✔
9
    """Slycot import failed."""
10
    pass
9✔
11

12
class ControlDimension(ValueError):
9✔
13
    """Raised when dimensions of system objects are not correct."""
14
    pass
9✔
15

16
class ControlArgument(TypeError):
9✔
17
    """Raised when arguments to a function are not correct."""
18
    pass
9✔
19

20
class ControlIndexError(IndexError):
9✔
21
    """Raised when arguments to an indexed object are not correct."""
22
    pass
9✔
23

24
class ControlMIMONotImplemented(NotImplementedError):
9✔
25
    """Function is not currently implemented for MIMO systems."""
26
    pass
9✔
27

28
class ControlNotImplemented(NotImplementedError):
9✔
29
    """Functionality is not yet implemented."""
30
    pass
9✔
31

32
# Utility function to see if Slycot is installed
33
slycot_installed = None
9✔
34
def slycot_check():
9✔
35
    """Return True if Slycot is installed, otherwise False."""
36
    global slycot_installed
37
    if slycot_installed is None:
9✔
38
        try:
9✔
39
            import slycot  # noqa: F401
9✔
40
            slycot_installed = True
5✔
41
        except:
4✔
42
            slycot_installed = False
4✔
43
    return slycot_installed
9✔
44

45

46
# Utility function to see if pandas is installed
47
pandas_installed = None
9✔
48
def pandas_check():
9✔
49
    """Return True if pandas is installed, otherwise False."""
50
    global pandas_installed
51
    if pandas_installed is None:
9✔
52
        try:
9✔
53
            import pandas  # noqa: F401
9✔
54
            pandas_installed = True
1✔
55
        except:
8✔
56
            pandas_installed = False
8✔
57
    return pandas_installed
9✔
58

59
# Utility function to see if cvxopt is installed
60
cvxopt_installed = None
9✔
61
def cvxopt_check():
9✔
62
    """Return True if cvxopt is installed, otherwise False."""
63
    global cvxopt_installed
64
    if cvxopt_installed is None:
9✔
65
        try:
9✔
66
            import cvxopt  # noqa: F401
9✔
67
            cvxopt_installed = True
5✔
68
        except:
4✔
69
            cvxopt_installed = False
4✔
70
    return cvxopt_installed
9✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc