Package mvpa :: Package mappers :: Module metric
[hide private]
[frames] | no frames]

Source Code for Module mvpa.mappers.metric

 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  """Data mapper""" 
10   
11  __docformat__ = 'restructuredtext' 
12   
13   
14  from mvpa.mappers.base import Mapper 
15  from mvpa.datasets.metric import Metric 
16  from mvpa.base.dochelpers import enhancedDocString 
17   
18   
19   
20 -class MetricMapper(Mapper, Metric):
21 """Mapper which has information about the metrics of the dataspace it is 22 mapping. 23 """
24 - def __init__(self, metric):
25 """Cheap initialisation. 26 27 'metric' is a subclass of Metric. 28 """ 29 Mapper.__init__(self) 30 Metric.__init__(self) 31 32 if not isinstance(metric, Metric): 33 raise ValueError, "MetricMapper has to be initialized with an " \ 34 "instance of a 'Metric' object. Got %s" \ 35 % `type(metric)` 36 self.__metric = metric
37 38 39 __doc__ = enhancedDocString('MetricMapper', locals(), Mapper, Metric) 40 41
42 - def getMetric(self):
43 """To make pylint happy""" 44 return self.__metric
45 46
47 - def setMetric(self, metric):
48 """To make pylint happy""" 49 self.__metric = metric
50 51 52 metric = property(fget=getMetric, fset=setMetric)
53