Package mvpa :: Package misc :: Module exceptions
[hide private]
[frames] | no frames]

Source Code for Module mvpa.misc.exceptions

 1  # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- 
 2  # vi: set ft=python sts=4 ts=4 sw=4 et: 
 3  ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## 
 4  # 
 5  #   See COPYING file distributed along with the PyMVPA package for the 
 6  #   copyright and license terms. 
 7  # 
 8  ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## 
 9  """Exception classes which might get thrown""" 
10   
11  __docformat__ = 'restructuredtext' 
12   
13 -class UnknownStateError(Exception):
14 """Thrown if the internal state of the class is not yet defined. 15 16 Classifiers and Algorithms classes might have properties, which 17 are not defined prior to training or invocation has happened. 18 """ 19
20 - def __init__(self, msg=""):
21 Exception.__init__(self) 22 self.__msg = msg
23
24 - def __str__(self):
25 return "Exception: " + self.__msg
26 27
28 -class DatasetError(Exception):
29 """Thrown if there is an internal problem with a Dataset. 30 31 ValueError exception is too generic to be used for any needed case, 32 thus this one is created 33 """ 34
35 - def __init__(self, msg=""):
36 Exception.__init__(self) 37 self.__msg = msg
38
39 - def __str__(self):
40 return "Dataset handling exception: " + self.__msg
41 42
43 -class ConvergenceError(Exception):
44 """Thrown if some algorithm does not converge to a solution. 45 """
46 - def __init__(self):
47 Exception.__init__(self)
48 49
50 -class InvalidHyperparameterError(Exception):
51 """Generic exception to be raised when setting improper values 52 as hyperparameters."""
53 - def __init__(self):
54 Exception.__init__(self)
55