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)

        points = self.points
        scalars = self.scalars
        x, y, z = self.x, self.y, self.z

        if 'points' in traits:
            x = points[:, 0].ravel()
            y = points[:, 1].ravel()
            z = points[:, 2].ravel()
            self.set(x=x, y=y, z=z, trait_change_notify=False)

        else:
            points = np.c_[x.ravel(), y.ravel(), z.ravel()].ravel()
            points.shape = (len(x), 3)
            self.set(points=points, trait_change_notify=False)

        # Create the dataset.
        n_pts = len(points) - 1
        lines = np.zeros((n_pts, 2), 'l')
        lines[:, 0] = np.arange(0, n_pts - 0.5, 1, 'l')
        lines[:, 1] = np.arange(1, n_pts + 0.5, 1, 'l')
        if self.dataset is None:
            pd = tvtk.PolyData()
        else:
            pd = self.dataset
        # Avoid lines refering to non existing points: First set the
        # lines to None, then set the points, then set the lines
        # refering to the new points.
        pd.set(lines=None)
        pd.set(points=points)
        pd.set(lines=lines)

        if scalars is not None and 0 > len(scalars):
            assert len(x) == len(scalars)
            pd.point_data.scalars = np.ravel(scalars)
            pd.point_data.scalars.name = 'scalars'

        self.dataset = pd

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