Xval

This revives #235. Now that all the other elements are in place, I think that this is ready for review and in principle ready to be merged upstream (once it's been reviewed and fixed up, of course!). I am excited about this PR - evaluation of DWI models is something that I have been thinking a lot about in the past couple of years, since I started working on DWI. 

This PR also demonstrates the power and elegance of the uniform `Model`/`Fit` API we have in place. GGT!

For now, this PR only implements cross-validation for CSD and for the tensor model, but future work could extend this to other models, by implementing their `predict` methods. 

Also : a lot of PEP8 fixes in the CSD module and elsewhere :-) 
Whoops. Oh well, may as well fix these things to Stefan's satisfaction. The
problem with putting off these kinds of changes is that then they never get
taken care of. I see what you mean about making the review more difficult,
though. Sorry about that.



On Wed, Jun 25, 2014 at 11:20 AM, MrBago <notifications@github.com> wrote:

> In dipy/reconst/shm.py:
>
> > @@ -42,6 +45,109 @@ def bandit(f):
> >      return bandit
> >
> >
> > +def forward_sdeconv_mat(r_rh, n):
> > +    """ Build forward spherical deconvolution matrix
> > +
> > +    Parameters
> > +    ----------
> > +    r_rh : ndarray
> > +        ndarray of rotational harmonics coefficients for the single fiber
>
> See @arokem <https://github.com/arokem> this is the problem with moving
> blocks of code, you become responsible for for what's in them even if it's
> just a copy paste :). I agree with you that we should have a standard that
> we can all follow going forward, but fixing this issue as part of a big
> pull request like this makes the review more difficult. We end up reviewing
> things that really have nothing to do with the specific pull request. In
> this case reverting it is probably going to cause even more trouble. I
> propose that in the future moving code around, pep8 and those kinds of
> changes get their own PR so we can merge them quickly and move on.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/nipy/dipy/pull/335/files#r14202901>.
>