On Thu, May 29, 2014 at 12:02 PM, Blake Griffith <notifications@github.com>
wrote:

> In distarray/local/maps.py:
>
> > @@ -96,7 +96,7 @@ def global_shape(self):
> >
> >      @property
> >      def global_size(self):
> > -        return reduce(operator.mul, self.global_shape)
> > +        return reduce(operator.mul, self.global_shape, 1)
>
> But NumPy can have size == 0 for example np.array([]).size.
>

Yes, that's a 1-dimensional array with zero elements in the 0th dimension.
 This reduce operation will return zero for that case as it should.

A zero-dimensional array (scalar array) has an empty shape tuple, and
always has exactly one element.  So when `self.global_shape == ()`, the
reduce operation should return 1, hence the need for the 1 default.

> —
> Reply to this email directly or view it on GitHub
> <https://github.com/enthought/distarray/pull/378/files#r13191430>.
>



-- 
Kurt W. Smith, Ph.D. <ksmith@enthought.com>
Enthought, Inc. <http://www.enthought.com>  | 512.536.1057