1
2
3
4
5
6
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
21 """Mapper which has information about the metrics of the dataspace it is
22 mapping.
23 """
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
43 """To make pylint happy"""
44 return self.__metric
45
46
48 """To make pylint happy"""
49 self.__metric = metric
50
51
52 metric = property(fget=getMetric, fset=setMetric)
53