Coverage for gpkit/exceptions.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.4.0, created at 2024-01-03 16:49 -0500

1"GPkit-specific Exception classes" 

2from . import DimensionalityError # pylint: disable=unused-import 

3 

4class MathematicallyInvalid(TypeError): 

5 "Raised whenever something violates a mathematical definition." 

6 

7class InvalidPosynomial(MathematicallyInvalid): 

8 "Raised if a Posynomial would be created with a negative coefficient" 

9 

10class InvalidGPConstraint(MathematicallyInvalid): 

11 "Raised if a non-GP-compatible constraint is used in a GP" 

12 

13class InvalidSGPConstraint(MathematicallyInvalid): 

14 "Raised if a non-SGP-compatible constraint is used in an SGP" 

15 

16 

17class UnnecessarySGP(ValueError): 

18 "Raised if an SGP is fully GP-compatible" 

19 

20class UnboundedGP(ValueError): 

21 "Raise if a GP is not fully bounded" 

22 

23 

24class InvalidLicense(RuntimeWarning): 

25 "Raised if a solver's license is missing, invalid, or expired." 

26 

27 

28class Infeasible(RuntimeWarning): 

29 "Raised if a model does not solve" 

30 

31class UnknownInfeasible(Infeasible): 

32 "Raised if a model does not solve for unknown reasons" 

33 

34class PrimalInfeasible(Infeasible): 

35 "Raised if a model returns a certificate of primal infeasibility" 

36 

37class DualInfeasible(Infeasible): 

38 "Raised if a model returns a certificate of dual infeasibility"