[pymvpa] detrend, polyord, optarg and the principle of least surprise

Emanuele Olivetti emanuele at relativita.com
Fri Mar 6 11:39:15 UTC 2009


Howdy,

While playing with polynomial detrend of fMRI data I noticed that
I forgot to specify the 'model' parameter and it happened that
I was just doing linear detrending.
Example:

detrend(dataset,polyord=5) # WRONG! This does just LINEAR detrending!!

detrend(dataset,model='regress',polyord=5) # CORRECT, poly(5) detrending

Would it be OK if we accept the first of the two examples as a valid
way to request polynomial detrending? It seems much more natural to
me and avoid stupid mistakes like those I did today :)

Note that I'd add the same idea for the 'opt_arg' parameter, and not
oly for 'polyord'. I.e., 'opt_arg'=!None would mean model='regress' too.

If this is OK I can add the trivial patch.

Emanuele

P.S.: My proposal is warmly supported by other two PyMVPA users here in
our Lab ;)





More information about the Pkg-ExpPsy-PyMVPA mailing list