Ticket #13425: trac_13425-sixth-review-gm.patch

File trac_13425-sixth-review-gm.patch, 4.3 KB (added by gmoose05, 7 years ago)
  • sage/combinat/cluster_algebra_quiver/mutation_type.py

    # HG changeset patch
    # User Gregg Musiker <musiker@math.mit.edu>
    # Date 1364270348 18000
    # Node ID a67adb86df7a546ba35da7047b5dd6f8c85aa36a
    # Parent  6d4290ee4aa9aa712c10cdae467b6118e5747232
    Fixed Sorting of Examples in mutation_type.py
    
    diff --git a/sage/combinat/cluster_algebra_quiver/mutation_type.py b/sage/combinat/cluster_algebra_quiver/mutation_type.py
    a b  
    12571257        sage: from sage.combinat.cluster_algebra_quiver.mutation_type import _mutation_type_test
    12581258
    12591259        sage: _mutation_type_test(2) # long time
    1260         True ('A', 2)
    12611260        True ('A', (1, 1), 1)
     1261        True ('A', 2)       
    12621262        True ('B', 2)
    12631263        True ('BC', 1, 1)
    12641264        True ('G', 2)
    12651265
    12661266        sage: _mutation_type_test(3) # long time
     1267        True ('A', (2, 1), 1)
    12671268        True ('A', 3)
    1268         True ('A', (2, 1), 1)
    12691269        True ('B', 3)
    12701270        True ('BB', 2, 1)
    12711271        True ('BC', 2, 1)
     
    12751275        True ('G', 2, 1)
    12761276
    12771277        sage: _mutation_type_test(4) # long time
    1278         True ('A', 4)
    12791278        True ('A', (2, 2), 1)
    12801279        True ('A', (3, 1), 1)
     1280        True ('A', 4)       
    12811281        True ('B', 4)
    12821282        True ('BB', 3, 1)
    12831283        True ('BC', 3, 1)
     
    12881288        True ('D', 4)
    12891289        True ('F', 4)
    12901290        True ('G', 2, (1, 1))
     1291        True ('G', 2, (1, 3))       
    12911292        True ('G', 2, (3, 3))
    1292         True ('G', 2, (1, 3))
    12931293
    12941294        sage: _mutation_type_test(5) # long time
    1295         True ('A', 5)
    12961295        True ('A', (3, 2), 1)
    12971296        True ('A', (4, 1), 1)
     1297        True ('A', 5)
    12981298        True ('B', 5)
    12991299        True ('BB', 4, 1)
    13001300        True ('BC', 4, 1)
     
    13041304        True ('CD', 4, 1)
    13051305        False ('D', 4, 1)
    13061306        True ('D', 5)
     1307        True ('F', 4, -1)       
    13071308        True ('F', 4, 1)
    1308         True ('F', 4, -1)
    13091309    """
    13101310    from sage.combinat.cluster_algebra_quiver.quiver_mutation_type import _construct_classical_mutation_classes
    13111311    from sage.combinat.cluster_algebra_quiver.mutation_class import _dig6_to_matrix, _matrix_to_digraph, _digraph_mutate, _edge_list_to_matrix, _dig6_to_digraph
    13121312    from sage.combinat.cluster_algebra_quiver.quiver import ClusterQuiver
    13131313    data = _construct_classical_mutation_classes( n )
    13141314    keys = data.keys()
    1315     keys.sort()
    1316     for mutation_type in keys:
     1315    for mutation_type in sorted(keys, key=str):
    13171316        mt = QuiverMutationType( mutation_type )
    13181317        print all( ClusterQuiver(_dig6_to_digraph(dig6)).mutation_type() == mt for dig6 in data[mutation_type]), mutation_type
    13191318    from sage.combinat.cluster_algebra_quiver.quiver_mutation_type import _construct_exceptional_mutation_classes
    13201319    data = _construct_exceptional_mutation_classes( n )
    1321     for mutation_type in data:
     1320    keys = data.keys()
     1321    for mutation_type in sorted(keys, key=str):
    13221322        mt = QuiverMutationType( mutation_type )
    13231323        print all( ClusterQuiver(_dig6_to_digraph(dig6)).mutation_type() == mt for dig6 in data[mutation_type]), mutation_type
    13241324
     
    14201420
    14211421        sage: from sage.combinat.cluster_algebra_quiver.mutation_type import _random_multi_tests
    14221422        sage: _random_multi_tests(2,100) # long time
     1423        testing ('A', (1, 1), 1)
    14231424        testing ('A', 2)
    1424         testing ('A', (1, 1), 1)
    14251425        testing ('B', 2)
    14261426        testing ('BC', 1, 1)
    14271427
    14281428        sage: _random_multi_tests(3,100) # long time
     1429        testing ('A', (2, 1), 1)
    14291430        testing ('A', 3)
    1430         testing ('A', (2, 1), 1)
    14311431        testing ('B', 3)
    14321432        testing ('BB', 2, 1)
    14331433        testing ('BC', 2, 1)
     
    14351435        testing ('CC', 2, 1)
    14361436
    14371437        sage: _random_multi_tests(4,100) # long time
    1438         testing ('A', 4)
    14391438        testing ('A', (2, 2), 1)
    14401439        testing ('A', (3, 1), 1)
     1440        testing ('A', 4)       
    14411441        testing ('B', 4)
    14421442        testing ('BB', 3, 1)
    14431443        testing ('BC', 3, 1)
     
    14491449    """
    14501450    from sage.combinat.cluster_algebra_quiver.quiver_mutation_type import _construct_classical_mutation_classes
    14511451    mutation_classes = _construct_classical_mutation_classes( n )
    1452     for mutation_type in sorted(mutation_classes):
     1452    for mutation_type in sorted(mutation_classes, key=str):
    14531453        _random_tests( mutation_type, k, mut_class=mutation_classes[mutation_type], nr_mut=nr_mut )