(self, name, data)
Update data for a index variable.
Update data for a index variable.
Update data for a index variable .
def update_index(self, name, data):
        """Update data for a index variable."""
        variable = self.get_variable(name)
        prevsize = len(variable['data'])
        variable['data'] = data
        newsize = len(data)
        # handle size changing
        if newsize != prevsize:
            # update the total size (in slicer)
            # self.slicer.set_size(newsize, doslice=False)
            self.indexsize = newsize
            # delete old buffers
            Attribute.delete(variable['buffer'])
            # create new buffer
            variable['buffer'] = Attribute.create()
            # load data
            Attribute.bind(variable['buffer'], variable['ndim'], index=True)
            Attribute.load(data, index=True)
        else:
            # update data
            Attribute.bind(variable['buffer'], variable['ndim'], index=True)
            Attribute.update(data, index=True)
def update_index ( self , name , data ) : variable = self . get_variable ( name ) prevsize = len ( variable [ 'data' ] ) variable [ 'data' ] = data newsize = len ( data ) # handle size changing if newsize != prevsize : # update the total size (in slicer) # self.slicer.set_size(newsize, doslice=False) self . indexsize = newsize # delete old buffers Attribute . delete ( variable [ 'buffer' ] ) # create new buffer variable [ 'buffer' ] = Attribute . create ( ) # load data Attribute . bind ( variable [ 'buffer' ] , variable [ 'ndim' ] , index = True ) Attribute . load ( data , index = True ) else : # update data Attribute . bind ( variable [ 'buffer' ] , variable [ 'ndim' ] , index = True ) Attribute . update ( data , index = True )