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

Source Code for Module mvpa.misc.exceptions

 1  #emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*- 
 2  #ex: set 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 -class DatasetError(Exception):
28 """Thrown if there is an internal problem with a Dataset. 29 30 ValueError exception is too generic to be used for any needed case, 31 thus this one is created 32 """ 33
34 - def __init__(self, msg=""):
35 Exception.__init__(self) 36 self.__msg = msg
37
38 - def __str__(self):
39 return "Dataset handling exception: " + self.__msg
40 41
42 -class ConvergenceError(Exception):
43 """Thrown if some algorithm does not converge to a solution. 44 """
45 - def __init__(self):
46 Exception.__init__(self)
47