def reset(self, **traits):
        """Creates the dataset afresh or resets existing data source."""

        # First set the attributes without really doing anything since
        # the notification handlers are not called.
        self.set(trait_change_notify=False, **traits)

        vectors = self.vectors
        scalars = self.scalars
        x, y, z = [np.atleast_3d(a) for a in (self.x, self.y, self.z)]

        u, v, w = self.u, self.v, self.w
        if 'vectors' in traits:
            u = vectors[:, 0].ravel()
            v = vectors[:, 1].ravel()
            w = vectors[:, 2].ravel()
            self.set(u=u, v=v, w=w, trait_change_notify=False)

        else:
            if u is not None and len(u) > 0:
                #vectors = np.concatenate([u[..., np.newaxis],
                #                             v[..., np.newaxis],
                #                             w[..., np.newaxis] ],
                #                axis=3)
                vectors = np.c_[u.ravel(), v.ravel(),
                                   w.ravel()].ravel()
                vectors.shape = (u.shape[0], u.shape[1], w.shape[2], 3)
                self.set(vectors=vectors, trait_change_notify=False)

        if vectors is not None and len(vectors) > 0 and scalars is not None:
            assert len(scalars) == len(vectors)

        if x.shape[0] <= 1:
            dx = 1
        else:
            dx = x[1, 0, 0] - x[0, 0, 0]
        if y.shape[1] <= 1:
            dy = 1
        else:
            dy = y[0, 1, 0] - y[0, 0, 0]
        if z.shape[2] <= 1:
            dz = 1
        else:
            dz = z[0, 0, 0] - z[0, 0, 1]

        if self.m_data is None:
            ds = ArraySource(transpose_input_array=True)
        else:
            ds = self.m_data
        old_scalar = ds.scalar_data
        ds.set(vector_data=vectors,
               origin=[x.min(), y.min(), z.min()],
               spacing=[dx, dy, dz],
               scalar_data=scalars)
        if scalars is old_scalar:
            ds._scalar_data_changed(scalars)

        self.dataset = ds.image_data
        self.m_data = ds

    ######################################################################
    # Non-public interface.
    ######################################################################
dataset/ETHPy150Open enthought/mayavi/mayavi/tools/sources.py/MArraySource.reset/swapped operands of `-`