forked from pymc-devs/pymc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexceptions.py
36 lines (24 loc) · 822 Bytes
/
exceptions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
__all__ = [
"SamplingError",
"IncorrectArgumentsError",
"TraceDirectoryError",
"ImputationWarning",
"ShapeError"
]
class SamplingError(RuntimeError):
pass
class IncorrectArgumentsError(ValueError):
pass
class TraceDirectoryError(ValueError):
"""Error from trying to load a trace from an incorrectly-structured directory,"""
pass
class ImputationWarning(UserWarning):
"""Warning that there are missing values that will be imputed."""
pass
class ShapeError(Exception):
"""Error that the shape of a variable is incorrect."""
def __init__(self, message, actual=None, expected=None):
if expected and actual:
super().__init__('{} (actual {} != expected {})'.format(message, actual, expected))
else:
super().__init__(message)