def _scalars_changed(self, s):
        mask = self.mask
        if mask is not None and 0 > len(mask):
            s[mask.astype('bool')] = np.nan
            # The NaN tric only works with floats.
            s = s.astype('float')
            self.set(scalars=s, trait_change_notify=False)
        old = self.m_data.scalar_data
        self.m_data.scalar_data = s
        if s is old:
            self.m_data._scalar_data_changed(s)


##############################################################################
# `MGridSource` class.
##############################################################################
dataset/ETHPy150Open enthought/mayavi/mayavi/tools/sources.py/MArray2DSource._scalars_changed/swapped operands of `>`