featuremapper/distribution.py
def _fast_vector_sum(self, values, theta):
        """
        Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).
        
        This implementation assumes that the values of the distribution needed for the 
        vector sum will not be changed and depends on cached values.
        
        """
        # vectors are represented in polar form as complex numbers
        v_sum = np.inner(values, theta)

        magnitude = abs(v_sum)
        direction = cmath.phase(v_sum)

        if v_sum == 0:
            self.undefined_vals += 1

        direction_radians = self._radians_to_bins(direction)

        # wrap the direction because arctan2 returns principal values
        wrapped_direction = wrap(self.axis_bounds[0], self.axis_bounds[1], direction_radians)

        return (magnitude, wrapped_direction)

        Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).
        
        This implementation assumes that the values of the distribution needed for the 
        vector sum will not be changed and depends on cached values.
        
        
Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).
This implementation assumes that the values of the distribution needed for the
vector sum will not be changed and depends on cached values.
Return the vector sum of the distribution as a tuple ( magnitude avgbinnum ) . This implementation assumes that the values of the distribution needed for the vector sum will not be changed and depends on cached values .
def _fast_vector_sum(self, values, theta):
        v_sum = np.inner(values, theta)
        magnitude = abs(v_sum)
        direction = cmath.phase(v_sum)
        if v_sum == 0:
            self.undefined_vals += 1
        direction_radians = self._radians_to_bins(direction)
        wrapped_direction = wrap(self.axis_bounds[0], self.axis_bounds[1], direction_radians)
        return (magnitude, wrapped_direction)
def _fast_vector_sum ( self , values , theta ) : v_sum = np . inner ( values , theta ) magnitude = abs ( v_sum ) direction = cmath . phase ( v_sum ) if v_sum == 0 : self . undefined_vals += 1 direction_radians = self . _radians_to_bins ( direction ) wrapped_direction = wrap ( self . axis_bounds [ 0 ] , self . axis_bounds [ 1 ] , direction_radians ) return ( magnitude , wrapped_direction )
Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).
Return the vector sum of the distribution as a tuple ( magnitude avgbinnum ) .
"""
        Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).
        
        This implementation assumes that the values of the distribution needed for the 
        vector sum will not be changed and depends on cached values.
        
        """ # vectors are represented in polar form as complex numbers # wrap the direction because arctan2 returns principal values
self
values
theta