dcf/interpolation.py
def update(self, x_list=list(), y_list=list()):
        """
        update interpolation data
        :param list(float) x_list: x values
        :param list(float) y_list: y values
        """
        if not y_list:
            for x in x_list:
                if x in self.x_list:
                    i = self.x_list.index(float(x))
                    self.x_list.pop(i)
                    self.y_list.pop(i)
        else:
            x_list = map(float, x_list)
            y_list = map(float, y_list)
            data = [(x, y) for x, y in zip(self.x_list, self.y_list) if x not in x_list]
            data.extend(zip(x_list, y_list))
            data = sorted(data)
            self.x_list = [float(x) for (x, y) in data]
            self.y_list = [float(y) for (x, y) in data]
def update(self, x_list=list(), y_list=list()):
        """
        update interpolation data
        :param list(float) x_list: x values
        :param list(float) y_list: y values
        """
        if not y_list:
            for x in x_list:
                if x in self.x_list:
                    i = self.x_list.index(float(x))
                    self.x_list.pop(i)
                    self.y_list.pop(i)
        else:
            x_list = map(float, x_list)
            y_list = map(float, y_list)
            data = [(x, y) for x, y in zip(self.x_list, self.y_list) if x not in x_list]
            data.extend(zip(x_list, y_list))
            data = sorted(data)
            self.x_list = [float(x) for (x, y) in data]
            self.y_list = [float(y) for (x, y) in data]
def update ( self , x_list = list ( ) , y_list = list ( ) ) : if not y_list : for x in x_list : if x in self . x_list : i = self . x_list . index ( float ( x ) ) self . x_list . pop ( i ) self . y_list . pop ( i ) else : x_list = map ( float , x_list ) y_list = map ( float , y_list ) data = [ ( x , y ) for x , y in zip ( self . x_list , self . y_list ) if x not in x_list ] data . extend ( zip ( x_list , y_list ) ) data = sorted ( data ) self . x_list = [ float ( x ) for ( x , y ) in data ] self . y_list = [ float ( y ) for ( x , y ) in data ]
update interpolation data
        :param list(float) x_list: x values
        :param list(float) y_list: y values
update interpolation data : param list ( float ) x_list : x values : param list ( float ) y_list : y values