exceptions.py
965 Bytes
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
37
38
39
40
41
42
"""
"""
from builtins import str
class BadSearchSpace(Exception):
"""Something is wrong in the description of the search space"""
class DuplicateLabel(BadSearchSpace):
"""A search space included a duplicate label """
class InvalidTrial(ValueError):
"""Non trial-like object used as Trial"""
def __init__(self, msg, obj):
ValueError.__init__(self, msg + " " + str(obj))
self.obj = obj
class InvalidResultStatus(ValueError):
"""Status of fmin evaluation was not in base.STATUS_STRINGS"""
def __init__(self, result):
ValueError.__init__(self)
self.result = result
class InvalidLoss(ValueError):
"""fmin evaluation returned invalid loss value"""
def __init__(self, result):
ValueError.__init__(self)
self.result = result
class AllTrialsFailed(Exception):
"""All optimization steps have finished with status base.STATUS_FAIL"""
# -- flake8 doesn't like blank last line