Use slicing to speed up tondarray

1. Add a property to `LocalArray` maps to provide a `slice` object representing the global index space covered by that map (when possible)
2. Use that property to speed up some usages of `tondarray`.

I'm not actually using `DistArray` slicing here, I'm using ndarray slicing.  This PR should speed up `tondarray` for `Block`, `Cyclic`, and `BlockCyclic` (for `block_size == 1`)

Partially addresses #452.
Yeah, I probably should do that.


On Thu, Jun 26, 2014 at 10:21 AM, Kurt Smith <notifications@github.com>
wrote:

> In distarray/dist/distarray.py:
>
> > @@ -316,11 +316,17 @@ def tondarray(self):
> >          """Returns the distributed array as an ndarray."""
> >          arr = np.empty(self.shape, dtype=self.dtype)
> >          local_arrays = self.get_localarrays()
> > -        for local_array in local_arrays:
> > -            maps = (list(ax_map.global_iter) for ax_map in
> > -                    local_array.distribution)
> > -            for index in product(*maps):
> > -                arr[index] = local_array.global_index[index]
> > +        try:
> > +            for local_array in local_arrays:
> > +                gslice = local_array.distribution.global_slice
> > +                arr[gslice] = local_array.ndarray[...]
>
> arr[gslice] = local_array.ndarray ?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/enthought/distarray/pull/468/files#r14253428>.
>