pKaTool/activity_fit/fit_pHact_J.py
def permute(self,variables,numgroups):
        """Construct a permutation of variables that is consistent with the geometry of the system"""
        groups=[]
        intpkas={}
        matrix={}
        count=0
        for group in range(numgroups):
            groups.append(group)
            intpkas[group]=variables[count]
            count=count+1
        # Matrix
        for group1 in groups:
            matrix[group1]={}
        for group1 in groups:
            for group2 in groups:
                if group1<group2:
                    intene=variables[count]
                    count=count+1
                    matrix[group1][group2]=intene
                    matrix[group2][group1]=intene
        #
        # permute so that group1 becomes last. subtract 1 from all other group numbers
        #
        variables=[]
        groups=groups[1:]+[groups[0]]
        for group in groups:
            variables.append(intpkas[group])
        # Matrix
        for pos1 in range(len(groups)):
            group1=groups[pos1]
            for pos2 in range(len(groups)):
                group2=groups[pos2]
                if pos1<pos2:
                    variables.append(matrix[group1][group2])
        return variables
Construct a permutation of variables that is consistent with the geometry of the system
Construct a permutation of variables that is consistent with the geometry of the system
Construct a permutation of variables that is consistent with the geometry of the system
def permute(self,variables,numgroups):
        groups=[]
        intpkas={}
        matrix={}
        count=0
        for group in range(numgroups):
            groups.append(group)
            intpkas[group]=variables[count]
            count=count+1
        for group1 in groups:
            matrix[group1]={}
        for group1 in groups:
            for group2 in groups:
                if group1<group2:
                    intene=variables[count]
                    count=count+1
                    matrix[group1][group2]=intene
                    matrix[group2][group1]=intene
         permute so that group1 becomes last. subtract 1 from all other group numbers
        variables=[]
        groups=groups[1:]+[groups[0]]
        for group in groups:
            variables.append(intpkas[group])
        for pos1 in range(len(groups)):
            group1=groups[pos1]
            for pos2 in range(len(groups)):
                group2=groups[pos2]
                if pos1<pos2:
                    variables.append(matrix[group1][group2])
        return variables
def permute ( self , variables , numgroups ) : groups = [ ] intpkas = { } matrix = { } count = 0 for group in range ( numgroups ) : groups . append ( group ) intpkas [ group ] = variables [ count ] count = count + 1 for group1 in groups : matrix [ group1 ] = { } for group1 in groups : for group2 in groups : if group1 < group2 : intene = variables [ count ] count = count + 1 matrix [ group1 ] [ group2 ] = intene matrix [ group2 ] [ group1 ] = intene variables = [ ] groups = groups [ 1 : ] + [ groups [ 0 ] ] for group in groups : variables . append ( intpkas [ group ] ) for pos1 in range ( len ( groups ) ) : group1 = groups [ pos1 ] for pos2 in range ( len ( groups ) ) : group2 = groups [ pos2 ] if pos1 < pos2 : variables . append ( matrix [ group1 ] [ group2 ] ) return variables
Construct a permutation of variables that is consistent with the geometry of the system
Construct a permutation of variables that is consistent with the geometry of the system
"""Construct a permutation of variables that is consistent with the geometry of the system""" # Matrix # # permute so that group1 becomes last. subtract 1 from all other group numbers # # Matrix
self
variables
numgroups