featuremapper/__init__.py
def apply_DSF(self, dsf):
        """
        Apply the given dsf DistributionStatisticFn on each element of
        the distribution_matrix

        Return a dictionary of dictionaries, with the same structure
        of the called DistributionStatisticFn, but with matrices as
        values, instead of scalars
        """

        if self._cyclic:
            # Cache theta value for vector sum since only depend on keys and is used
            # for every every cyclic Distribution in the DistributionMatrix
            theta =  calc_theta(np.array(list(self._response_data.keys())), self._axis_range)
        else:
            theta = None

        shape = self._empty_matrix.shape
        result = {}

        # this is an extra call to the dsf() DistributionStatisticFn,
        # in order to retrieve
        # the dictionaries structure, and allocate the necessary matrices
        response = dsf(self._make_distribution(theta, 0, 0))
        for k, maps in response.items():
            result[k] = {}
            for m in maps.keys():
                result[k][m] = np.zeros(shape, np.float64)
                
        for i in range(shape[0]):
            for j in range(shape[1]):
                response = dsf(self._make_distribution(theta, i, j))
                for k, maps in response.items():
                    for item, item_value in maps.items():
                        result[k][item][i, j] = item_value

        return result

        Apply the given dsf DistributionStatisticFn on each element of
        the distribution_matrix

        Return a dictionary of dictionaries, with the same structure
        of the called DistributionStatisticFn, but with matrices as
        values, instead of scalars
        
Apply the given dsf DistributionStatisticFn on each element of
the distribution_matrix

Return a dictionary of dictionaries, with the same structure
of the called DistributionStatisticFn, but with matrices as
values, instead of scalars
Apply the given dsf DistributionStatisticFn on each element of the distribution_matrix Return a dictionary of dictionaries with the same structure of the called DistributionStatisticFn but with matrices as values instead of scalars
def apply_DSF(self, dsf):
        if self._cyclic:
            theta =  calc_theta(np.array(list(self._response_data.keys())), self._axis_range)
        else:
            theta = None
        shape = self._empty_matrix.shape
        result = {}
        response = dsf(self._make_distribution(theta, 0, 0))
        for k, maps in response.items():
            result[k] = {}
            for m in maps.keys():
                result[k][m] = np.zeros(shape, np.float64)
        for i in range(shape[0]):
            for j in range(shape[1]):
                response = dsf(self._make_distribution(theta, i, j))
                for k, maps in response.items():
                    for item, item_value in maps.items():
                        result[k][item][i, j] = item_value
        return result
def apply_DSF ( self , dsf ) : if self . _cyclic : theta = calc_theta ( np . array ( list ( self . _response_data . keys ( ) ) ) , self . _axis_range ) else : theta = None shape = self . _empty_matrix . shape result = { } response = dsf ( self . _make_distribution ( theta , 0 , 0 ) ) for k , maps in response . items ( ) : result [ k ] = { } for m in maps . keys ( ) : result [ k ] [ m ] = np . zeros ( shape , np . float64 ) for i in range ( shape [ 0 ] ) : for j in range ( shape [ 1 ] ) : response = dsf ( self . _make_distribution ( theta , i , j ) ) for k , maps in response . items ( ) : for item , item_value in maps . items ( ) : result [ k ] [ item ] [ i , j ] = item_value return result
Apply the given dsf DistributionStatisticFn on each element of
the distribution_matrix
Apply the given dsf DistributionStatisticFn on each element of the distribution_matrix
"""
        Apply the given dsf DistributionStatisticFn on each element of
        the distribution_matrix

        Return a dictionary of dictionaries, with the same structure
        of the called DistributionStatisticFn, but with matrices as
        values, instead of scalars
        """ # Cache theta value for vector sum since only depend on keys and is used # for every every cyclic Distribution in the DistributionMatrix # this is an extra call to the dsf() DistributionStatisticFn, # in order to retrieve # the dictionaries structure, and allocate the necessary matrices
self
dsf