[pymvpa] little bugs in (Mapped)Dataset.selectFeatures ?

Emanuele Olivetti emanuele at relativita.com
Tue Mar 17 16:45:28 UTC 2009


In line 130 of mvpa/datasets/mapped.py the MappedDataset.selectFeatutures()
calls "Dataset.selectFeatures(self, ids)" to do the actual selection.
Unfortunately the two methods has different default values for "sort":
 MappedDataset.selectFeatutures(self, ids, plain=False, sort=False)
while
 Dataset.selectFeatures(self, ids=None, sort=True, groups=None)
so the call in line 130 overrides MappedDataset with Dataset default value.
This means that whatever choice of "sort" is made in MappedDataset, it is
not considered when calling MappedDataset.selectFeatutures(). In other
words you get sorted features always, even if you say sort=False.

I guess that line 130 should be simply:
    sdata = Dataset.selectFeatures(self, ids, sort)
But I'd like to ask your opinion on this since the Datasets architecture
and details are not fully clear to me yet.

Another detail: if you choose to sort IDs (sort=True) then the vector of
IDs "ids" passed as argument to the selectFeatures() method is sorted as
well. When the user calls MappedDataset.selectFeatutures(ids) he/she
gets a new dataset and... unexpectedly "ids" is sorted. This caused a
bit of headache to me today. Is this unexpected side-effect necessary?

P.S. If you prefer, you can just express your opinions and I'll made the
fixes.

Ciao,

Emanuele





More information about the Pkg-ExpPsy-PyMVPA mailing list