ragtag_utilities/ScaffoldGraph.py
def _merge_edge_dicts(*edge_dicts):
        """
        Given a list of edge data, combine like data into lists.
        Sum the weight list and provide that as the new weight.
        :param edge_dicts: list of edge data dictionaries
        :return: merged edge data dictionary
        """
        data = dict()
        for k in edge_dicts[0]:
            data[k] = [edge_dicts[0][k]]

        for new_dict in edge_dicts[1:]:
            for k in new_dict:
                if k not in data:
                    raise ValueError("Inconsistent edge data.")

                data[k].append(new_dict[k])

        data["original_weights"] = data["weight"]
        data["weight"] = sum(data["weight"])
        return data

        Given a list of edge data, combine like data into lists.
        Sum the weight list and provide that as the new weight.
        :param edge_dicts: list of edge data dictionaries
        :return: merged edge data dictionary
        
Given a list of edge data, combine like data into lists.
Sum the weight list and provide that as the new weight.
Given a list of edge data combine like data into lists . Sum the weight list and provide that as the new weight .
def _merge_edge_dicts(*edge_dicts):
        data = dict()
        for k in edge_dicts[0]:
            data[k] = [edge_dicts[0][k]]
        for new_dict in edge_dicts[1:]:
            for k in new_dict:
                if k not in data:
                    raise ValueError("Inconsistent edge data.")
                data[k].append(new_dict[k])
        data["original_weights"] = data["weight"]
        data["weight"] = sum(data["weight"])
        return data
def _merge_edge_dicts ( * edge_dicts ) : data = dict ( ) for k in edge_dicts [ 0 ] : data [ k ] = [ edge_dicts [ 0 ] [ k ] ] for new_dict in edge_dicts [ 1 : ] : for k in new_dict : if k not in data : raise ValueError ( "Inconsistent edge data." ) data [ k ] . append ( new_dict [ k ] ) data [ "original_weights" ] = data [ "weight" ] data [ "weight" ] = sum ( data [ "weight" ] ) return data
Given a list of edge data, combine like data into lists.
Given a list of edge data combine like data into lists .
"""
        Given a list of edge data, combine like data into lists.
        Sum the weight list and provide that as the new weight.
        :param edge_dicts: list of edge data dictionaries
        :return: merged edge data dictionary
        """
merged edge data dictionary
merged edge data dictionary
edge_dicts
list of edge data dictionaries
list of edge data dictionaries