Ticket #13425: trac_13425-review_five-cs.patch

File trac_13425-review_five-cs.patch, 4.5 KB (added by stumpc5, 7 years ago)
  • sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py

    # HG changeset patch
    # User Christian Stump <christian.stump at gmail.com>
    # Date 1364222722 -3600
    # Node ID 76cd65f758faf93931bf6107f71263a28b52f080
    # Parent  c21b4398f55be652478897d112cff384df9f8766
    Trac 13425: fixed cmp issue in doctests
    
    diff --git a/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py b/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py
    a b def _construct_classical_mutation_classe 
    19541954
    19551955    sage: from sage.combinat.cluster_algebra_quiver.quiver_mutation_type import _construct_classical_mutation_classes
    19561956    sage: rank_2_classes = _construct_classical_mutation_classes(2) # long time
    1957     sage: for mut_class in sorted(rank_2_classes.keys()): # long time
     1957    sage: for mut_class in sorted(rank_2_classes.keys(),key=str): # long time
    19581958    ...     print mut_class, rank_2_classes[mut_class]
     1959    ('A', (1, 1), 1) [('AO', (((0, 1), (2, -2)),))]
    19591960    ('A', 2) [('AO', ())]
    1960     ('A', (1, 1), 1) [('AO', (((0, 1), (2, -2)),))]
    19611961    ('B', 2) [('AO', (((0, 1), (1, -2)),)), ('AO', (((0, 1), (2, -1)),))]
    19621962    ('BC', 1, 1) [('AO', (((0, 1), (1, -4)),)), ('AO', (((0, 1), (4, -1)),))]
    19631963    """
    def _construct_exceptional_mutation_clas 
    20092009
    20102010    sage: from sage.combinat.cluster_algebra_quiver.quiver_mutation_type import _construct_exceptional_mutation_classes
    20112011    sage: rank_3_exceptional = _construct_exceptional_mutation_classes(3) # long time
    2012     sage: for mut_class in sorted(rank_3_exceptional.keys()): # long time
     2012    sage: for mut_class in sorted(rank_3_exceptional.keys(), key=str): # long time
    20132013    ...     print mut_class, rank_3_exceptional[mut_class]
    20142014    ('G', 2, -1) [('BH?', (((1, 2), (1, -3)),)), ('BGO', (((2, 1), (3, -1)),)), ('BW?', (((0, 1), (3, -1)),)), ('BP?', (((0, 1), (1, -3)),)),
    20152015     ('BP_', (((0, 1), (1, -3)), ((2, 0), (3, -1)))), ('BP_', (((0, 1), (3, -1)), ((1, 2), (1, -3)), ((2, 0), (2, -2))))]
    def _save_data_dig6(n, types='ClassicalE 
    20702070        [('A', 1)]
    20712071        <BLANKLINE>
    20722072        The following types are saved to file ... and will now be used to determine quiver mutation types:
    2073         [('A', 2), ('A', (1, 1), 1), ('B', 2), ('BC', 1, 1), ('G', 2)]
     2073        [('A', (1, 1), 1), ('A', 2), ('B', 2), ('BC', 1, 1), ('G', 2)]
    20742074
    20752075        sage: save_quiver_data(2,up_to=False) # indirect doctest
    20762076        <BLANKLINE>
    20772077        The following types are saved to file ... and will now be used to determine quiver mutation types:
    2078         [('A', 2), ('A', (1, 1), 1), ('B', 2), ('BC', 1, 1), ('G', 2)]
     2078        [('A', (1, 1), 1), ('A', 2), ('B', 2), ('BC', 1, 1), ('G', 2)]
    20792079
    20802080        sage: save_quiver_data(2,up_to=False, types='Classical') # indirect doctest
    20812081        <BLANKLINE>
    20822082        The following types are saved to file ... and will now be used to determine quiver mutation types:
    2083         [('A', 2), ('A', (1, 1), 1), ('B', 2), ('BC', 1, 1)]
     2083        [('A', (1, 1), 1), ('A', 2), ('B', 2), ('BC', 1, 1)]
    20842084
    20852085        sage: save_quiver_data(2,up_to=False, types='Exceptional') # indirect doctest
    20862086        <BLANKLINE>
    def _save_data_dig6(n, types='ClassicalE 
    21092109    cPickle.dump(data, f)
    21102110    f.close()
    21112111    if verbose:
    2112         keys = data.keys()
    2113         keys.sort()
     2112        keys = sorted(data.keys(),key=str)
    21142113        print "\nThe following types are saved to file", types_file,"and will now be used to determine quiver mutation types:"
    21152114        print keys
    21162115
    def save_quiver_data(n, up_to=True, type 
    21402139        [('A', 1)]
    21412140        <BLANKLINE>
    21422141        The following types are saved to file ... and will now be used to determine quiver mutation types:
    2143         [('A', 2), ('A', (1, 1), 1), ('B', 2), ('BC', 1, 1), ('G', 2)]
     2142        [('A', (1, 1), 1), ('A', 2), ('B', 2), ('BC', 1, 1), ('G', 2)]
    21442143
    21452144        sage: save_quiver_data(2,up_to=False)
    21462145        <BLANKLINE>
    21472146        The following types are saved to file ... and will now be used to determine quiver mutation types:
    2148         [('A', 2), ('A', (1, 1), 1), ('B', 2), ('BC', 1, 1), ('G', 2)]
     2147        [('A', (1, 1), 1), ('A', 2), ('B', 2), ('BC', 1, 1), ('G', 2)]
    21492148
    21502149        sage: save_quiver_data(2,up_to=False, types='Classical')
    21512150        <BLANKLINE>
    21522151        The following types are saved to file ... and will now be used to determine quiver mutation types:
    2153         [('A', 2), ('A', (1, 1), 1), ('B', 2), ('BC', 1, 1)]
     2152        [('A', (1, 1), 1), ('A', 2), ('B', 2), ('BC', 1, 1)]
    21542153
    21552154        sage: save_quiver_data(2,up_to=False, types='Exceptional')
    21562155        <BLANKLINE>