featuremapper/__init__.py
def update(self, new_values, feature):
        """
        Add a new matrix of histogram values for a given bin value.
        """
        if self._cyclic==False:
            if not (self._axis_bounds[0] <= feature <= self._axis_bounds[1]):
                raise ValueError("Bin outside bounds.")
        # CEBALERT: Neet to support wrapping of bin values
        # else:  new_bin = wrap(self.axis_bounds[0], self.axis_bounds[1], bin)
        new_bin = feature

        non_zeros = np.zeros_like(self._empty_matrix, dtype=np.uint32)
        non_zeros[new_values.nonzero()] = 1
        
        self._total_value += new_values
        self._total_count += non_zeros
        
        if new_bin not in self._response_data:
            self._response_data[new_bin] = np.zeros_like(self._empty_matrix)
            self._counts[new_bin] = np.zeros_like(self._empty_matrix, dtype=np.uint32)

        if self._keep_peak:
            self._response_data[new_bin] = np.maximum(self._response_data[new_bin], new_values)
        else:
            self._response_data[new_bin] += new_values
            
        self._counts[new_bin] += non_zeros

        Add a new matrix of histogram values for a given bin value.
        
Add a new matrix of histogram values for a given bin value.
Add a new matrix of histogram values for a given bin value .
def update(self, new_values, feature):
        if self._cyclic==False:
            if not (self._axis_bounds[0] <= feature <= self._axis_bounds[1]):
                raise ValueError("Bin outside bounds.")
        new_bin = feature
        non_zeros = np.zeros_like(self._empty_matrix, dtype=np.uint32)
        non_zeros[new_values.nonzero()] = 1
        self._total_value += new_values
        self._total_count += non_zeros
        if new_bin not in self._response_data:
            self._response_data[new_bin] = np.zeros_like(self._empty_matrix)
            self._counts[new_bin] = np.zeros_like(self._empty_matrix, dtype=np.uint32)
        if self._keep_peak:
            self._response_data[new_bin] = np.maximum(self._response_data[new_bin], new_values)
        else:
            self._response_data[new_bin] += new_values
        self._counts[new_bin] += non_zeros
def update ( self , new_values , feature ) : if self . _cyclic == False : if not ( self . _axis_bounds [ 0 ] <= feature <= self . _axis_bounds [ 1 ] ) : raise ValueError ( "Bin outside bounds." ) new_bin = feature non_zeros = np . zeros_like ( self . _empty_matrix , dtype = np . uint32 ) non_zeros [ new_values . nonzero ( ) ] = 1 self . _total_value += new_values self . _total_count += non_zeros if new_bin not in self . _response_data : self . _response_data [ new_bin ] = np . zeros_like ( self . _empty_matrix ) self . _counts [ new_bin ] = np . zeros_like ( self . _empty_matrix , dtype = np . uint32 ) if self . _keep_peak : self . _response_data [ new_bin ] = np . maximum ( self . _response_data [ new_bin ] , new_values ) else : self . _response_data [ new_bin ] += new_values self . _counts [ new_bin ] += non_zeros
Add a new matrix of histogram values for a given bin value.
Add a new matrix of histogram values for a given bin value .
"""
        Add a new matrix of histogram values for a given bin value.
        """ # CEBALERT: Neet to support wrapping of bin values # else:  new_bin = wrap(self.axis_bounds[0], self.axis_bounds[1], bin)
self
new_values
feature