#NEWLINE# @ staticmethod #NEWLINE# def clean( conn , group = None , color = None , labels = None ) : #NEWLINE# #INDENT# '\n        Create a circular graph from connectivity data.\n\n        .. image:: circle.png\n\n        Parameters\n        ----------\n        conn : array-like, (n,n) or (n,3) or (n,2)\n            Input connectivity data as either a matrix or a list of links.\n            Matrix can be binary or continuous valued. Links should contain\n            either 2 elements per link (source, target),\n            or 3 elements (source, target, value).\n\n        group : array-like, optional, (m,n) or (n,)\n            Hierarchical group assignments, where m is\n            the number of groups\n\n        color : array-like, optional, singleton or (k,3)\n            Single rgb value or array to set colors of top-level group,\n            where k is the number of unique elements in the top-level group\n\n        labels : array-like, optional, (n,)\n            Array of text labels to label nodes\n        ' #NEWLINE# links = parse_links ( conn ) #NEWLINE# nodes = parse_nodes ( conn ) #NEWLINE# outdict = { #NEWLINE# #INDENT# 'links' : links , #NEWLINE# 'nodes' : nodes , #NEWLINE# #UNINDENT# } #NEWLINE# outdict = add_property ( outdict , labels , 'labels' ) #NEWLINE# outdict = add_property ( outdict , color , 'color' ) #NEWLINE# if ( group is not None ) : #NEWLINE# #INDENT# if isinstance ( group , ndarray ) : #NEWLINE# #INDENT# group = group . tolist ( ) #NEWLINE# #UNINDENT# if isinstance ( group , list ) : #NEWLINE# #INDENT# if ( not isinstance ( group [ 0 ] , list ) ) : #NEWLINE# #INDENT# if isinstance ( group [ 0 ] , ndarray ) : #NEWLINE# #INDENT# group = [ g . tolist ( ) for g in group ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# group = [ group ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'group must be list or nested list' ) #NEWLINE# #UNINDENT# outdict [ 'group' ] = group #NEWLINE# #UNINDENT# return outdict