Ticket #14473: trac_14473.patch

File trac_14473.patch, 14.6 KB (added by ncohen, 8 years ago)
  • doc/en/reference/combinat/posets.rst

    # HG changeset patch
    # User Nathann Cohen <nathann.cohen@gmail.com>
    # Date 1366579450 -7200
    # Node ID 14149561a0c237e27b76c801e027062b7c08873e
    # Parent  c2ad2879bcf282c683b57b6968d21114c3d9a7f1
    Old deprecation warnings, and depth of doc index
    
    diff --git a/doc/en/reference/combinat/posets.rst b/doc/en/reference/combinat/posets.rst
    a b  
    22======
    33
    44.. toctree::
    5    :maxdepth: 2
     5   :maxdepth: 1
    66
    77   ../sage/combinat/posets/posets
    88   ../sage/combinat/posets/hasse_diagram
  • sage/combinat/combinat.py

    diff --git a/sage/combinat/combinat.py b/sage/combinat/combinat.py
    a b  
    13731373            raise ValueError, "%s not in %s"%(x, self)
    13741374
    13751375    Element = CombinatorialObject # mostly for backward compatibility
    1376 
    13771376    @lazy_attribute
    13781377    def element_class(self):
    13791378        """
  • sage/combinat/e_one_star.py

    diff --git a/sage/combinat/e_one_star.py b/sage/combinat/e_one_star.py
    a b  
    799799        else:
    800800            return "Patch of %s faces"%len(self)
    801801
    802     def add(self, other):
    803         r"""
    804         Returns a Patch consisting of the union of self and other.
    805 
    806         INPUT:
    807 
    808         - ``other`` - a Patch or a Face or a finite iterable of faces
    809 
    810         EXAMPLES::
    811 
    812             sage: from sage.combinat.e_one_star import Face, Patch
    813             sage: P = Patch([Face((0,0,0),1), Face((0,0,0),2)])
    814             sage: P.add(Face((1,2,3), 3))   #not tested
    815             Patch: [[(0, 0, 0), 1]*, [(0, 0, 0), 2]*, [(1, 2, 3), 3]*]
    816             sage: P.add([Face((1,2,3), 3), Face((2,3,3), 2)])   #not tested
    817             Patch: [[(0, 0, 0), 1]*, [(0, 0, 0), 2]*, [(1, 2, 3), 3]*, [(2, 3, 3), 2]*]
    818         """
    819         from sage.misc.superseded import deprecation
    820         deprecation(12384, "Objects sage.combinat.e_one_star.Patch " + \
    821                     "are immutable since Sage-4.7.1. " + \
    822                     "Use the usual addition (P + Q) or use the Patch.union method.")
    823         return self.union(other)
    824 
    825802    def union(self, other):
    826803        r"""
    827804        Returns a Patch consisting of the union of self and other.
     
    1013990                positions.append(y-x)
    1014991        return positions
    1015992
    1016     def apply_substitution(self, E, iterations=1):
    1017         r"""
    1018         Returns the image of self by the E1Star substitution ``E``.
    1019 
    1020         The color of every new face in the image is given the same color as its preimage.
    1021 
    1022         INPUT:
    1023 
    1024         - ``E`` - an instance of the ``E1Star`` class. Its domain alphabet must
    1025           be of the same size as the dimension of the ambient space of the
    1026           faces.
    1027         - ``iterations`` - integer (optional, default: 1)
    1028           number of times the substitution E is applied
    1029 
    1030         EXAMPLES::
    1031 
    1032             sage: from sage.combinat.e_one_star import E1Star, Face, Patch
    1033             sage: sigma = WordMorphism({1:[1,2], 2:[1,3], 3:[1]})
    1034             sage: E = E1Star(sigma)
    1035             sage: P = Patch([Face((0,0,0),t) for t in [1,2,3]])
    1036             sage: P.apply_substitution(E,6)     #not tested
    1037             Patch of 105 faces
    1038         """
    1039         if not isinstance(E, E1Star):
    1040             raise TypeError, "E must be an instance of E1Star"
    1041 
    1042         from sage.misc.superseded import deprecation
    1043         deprecation(12384, "Objects sage.combinat.e_one_star.Patch " + \
    1044                     "are immutable since Sage-4.7.1. " + \
    1045                     "Use the usual calling method of E1Star (E(P)).")
    1046         return E(self, iterations=iterations)
    1047 
    1048993    def repaint(self, cmap='Set1'):
    1049994        r"""
    1050995        Repaints all the faces of self from the given color map.
  • sage/combinat/posets/all.py

    diff --git a/sage/combinat/posets/all.py b/sage/combinat/posets/all.py
    a b  
    55from lattices import JoinSemilattice
    66
    77from poset_examples import posets, Posets
    8 
    9 ###########################################################################
    10 ##### DEPRECATION WARNINGS ################################################
    11 ##### Added 28 April 2009 #################################################
    12 ###########################################################################
    13 
    14 from sage.misc.superseded import deprecation
    15 
    16 def BooleanLattice(*args, **kwds):
    17     r"""
    18     This function is deprecated and will be removed in a future
    19     version of Sage. Please use ``Posets.BooleanLattice`` instead.
    20 
    21     TESTS::
    22 
    23         sage: BooleanLattice(3)
    24         doctest:...: DeprecationWarning: BooleanLattice is deprecated, use Posets.BooleanLattice instead!
    25         See http://trac.sagemath.org/10998 for details.
    26         Finite lattice containing 8 elements
    27     """
    28     deprecation(10998, "%s is deprecated, use Posets.%s instead!" % \
    29            ("BooleanLattice", "BooleanLattice"))
    30     return Posets.BooleanLattice(*args, **kwds)
    31 
    32 def ChainPoset(*args, **kwds):
    33     r"""
    34     This function is deprecated and will be removed in a future
    35     version of Sage. Please use ``Posets.ChainPoset`` instead.
    36 
    37     TESTS::
    38 
    39         sage: ChainPoset(3)
    40         doctest:...: DeprecationWarning: ChainPoset is deprecated, use Posets.ChainPoset instead!
    41         See http://trac.sagemath.org/10998 for details.
    42         Finite lattice containing 3 elements
    43     """
    44     deprecation(10998, "%s is deprecated, use Posets.%s instead!" % \
    45            ("ChainPoset","ChainPoset"))
    46     return Posets.ChainPoset(*args, **kwds)
    47 
    48 def AntichainPoset(*args, **kwds):
    49     r"""
    50     This function is deprecated and will be removed in a future
    51     version of Sage. Please use ``Posets.AntichainPoset`` instead.
    52 
    53     TESTS::
    54 
    55         sage: AntichainPoset(3)
    56         doctest:...: DeprecationWarning: AntichainPoset is deprecated, use Posets.AntichainPoset instead!
    57         See http://trac.sagemath.org/10998 for details.
    58         Finite poset containing 3 elements
    59     """
    60     deprecation(10998, "%s is deprecated, use Posets.%s instead!" % \
    61            ("AntichainPoset","AntichainPoset"))
    62     return Posets.AntichainPoset(*args, **kwds)
    63 
    64 def PentagonPoset(*args, **kwds):
    65     r"""
    66     This function is deprecated and will be removed in a future
    67     version of Sage. Please use ``Posets.PentagonPoset`` instead.
    68 
    69     TESTS::
    70 
    71         sage: PentagonPoset()
    72         doctest:...: DeprecationWarning: PentagonPoset is deprecated, use Posets.PentagonPoset instead!
    73         See http://trac.sagemath.org/10998 for details.
    74         Finite lattice containing 5 elements
    75     """
    76     deprecation(10998, "%s is deprecated, use Posets.%s instead!" % \
    77            ("PentagonPoset","PentagonPoset"))
    78     return Posets.PentagonPoset(*args, **kwds)
    79 
    80 def DiamondPoset(*args, **kwds):
    81     r"""
    82     This function is deprecated and will be removed in a future
    83     version of Sage. Please use ``Posets.DiamondPoset`` instead.
    84 
    85     TESTS::
    86 
    87         sage: DiamondPoset(3)
    88         doctest:...: DeprecationWarning: DiamondPoset is deprecated, use Posets.DiamondPoset instead!
    89         See http://trac.sagemath.org/10998 for details.
    90         Finite lattice containing 3 elements
    91     """
    92     deprecation(10998, "%s is deprecated, use Posets.%s instead!" % \
    93            ("DiamondPoset","DiamondPoset"))
    94     return Posets.DiamondPoset(*args, **kwds)
    95 
    96 def PosetOfIntegerCompositions(*args, **kwds):
    97     r"""
    98     This function is deprecated and will be removed in a future
    99     version of Sage. Please use ``Posets.IntegerCompositions`` instead.
    100 
    101     TESTS::
    102 
    103         sage: PosetOfIntegerCompositions(3)
    104         doctest:...: DeprecationWarning: PosetOfIntegerCompositions is deprecated, use Posets.IntegerCompositions instead!
    105         See http://trac.sagemath.org/10998 for details.
    106         Finite poset containing 4 elements
    107     """
    108     deprecation(10998, "%s is deprecated, use Posets.%s instead!" % \
    109            ("PosetOfIntegerCompositions","IntegerCompositions"))
    110     return Posets.IntegerCompositions(*args, **kwds)
    111 
    112 def PosetOfIntegerPartitions(*args, **kwds):
    113     r"""
    114     This function is deprecated and will be removed in a future
    115     version of Sage. Please use ``Posets.IntegerPartitions`` instead.
    116 
    117     TESTS::
    118 
    119         sage: PosetOfIntegerPartitions(3)
    120         doctest:...: DeprecationWarning: PosetOfIntegerPartitions is deprecated, use Posets.IntegerPartitions instead!
    121         See http://trac.sagemath.org/10998 for details.
    122         Finite poset containing 3 elements
    123     """
    124     deprecation(10998, "%s is deprecated, use Posets.%s instead!" % \
    125            ("PosetOfIntegerPartitions","IntegerPartitions"))
    126     return Posets.IntegerPartitions(*args, **kwds)
    127 
    128 def PosetOfRestrictedIntegerPartitions(*args, **kwds):
    129     r"""
    130     This function is deprecated and will be removed in a future
    131     version of Sage. Please use ``Posets.RestrictedIntegerPartitions`` instead.
    132 
    133     TESTS::
    134 
    135         sage: PosetOfRestrictedIntegerPartitions(3)
    136         doctest:...: DeprecationWarning: PosetOfRestrictedIntegerPartitions is deprecated, use Posets.RestrictedIntegerPartitions instead!
    137         See http://trac.sagemath.org/10998 for details.
    138         Finite poset containing 3 elements
    139     """
    140     deprecation(10998, "%s is deprecated, use Posets.%s instead!" % \
    141            ("PosetOfRestrictedIntegerPartitions","RestrictedIntegerPartitions"))
    142     return Posets.RestrictedIntegerPartitions(*args, **kwds)
    143 
    144 def RandomPoset(*args, **kwds):
    145     r"""
    146     This function is deprecated and will be removed in a future
    147     version of Sage. Please use ``Posets.RandomPoset`` instead.
    148 
    149     TESTS::
    150 
    151         sage: RandomPoset(17,.15)
    152         doctest:...: DeprecationWarning: RandomPoset is deprecated, use Posets.RandomPoset instead!
    153         See http://trac.sagemath.org/10998 for details.
    154         Finite poset containing 17 elements
    155     """
    156     deprecation(10998, "%s is deprecated, use Posets.%s instead!" % \
    157            ("RandomPoset","RandomPoset"))
    158     return Posets.RandomPoset(*args, **kwds)
    159 
    160 
    161 def SymmetricGroupBruhatOrderPoset(*args, **kwds):
    162     r"""
    163     This function is deprecated and will be removed in a future
    164     version of Sage. Please use ``Posets.SymmetricGroupBruhatOrderPoset`` instead.
    165 
    166     TESTS::
    167 
    168         sage: SymmetricGroupBruhatOrderPoset(3)
    169         doctest:...: DeprecationWarning: SymmetricGroupBruhatOrderPoset is deprecated, use Posets.SymmetricGroupBruhatOrderPoset instead!
    170         See http://trac.sagemath.org/10998 for details.
    171         Finite poset containing 6 elements
    172     """
    173     deprecation(10998, "%s is deprecated, use Posets.%s instead!" % \
    174            ("SymmetricGroupBruhatOrderPoset","SymmetricGroupBruhatOrderPoset"))
    175     return Posets.SymmetricGroupBruhatOrderPoset(*args, **kwds)
    176 
    177 def SymmetricGroupWeakOrderPoset(*args, **kwds):
    178     r"""
    179     This function is deprecated and will be removed in a future
    180     version of Sage. Please use ``Posets.SymmetricGroupWeakOrderPoset`` instead.
    181 
    182     TESTS::
    183 
    184         sage: SymmetricGroupWeakOrderPoset(3)
    185         doctest:...: DeprecationWarning: SymmetricGroupWeakOrderPoset is deprecated, use Posets.SymmetricGroupWeakOrderPoset instead!
    186         See http://trac.sagemath.org/10998 for details.
    187         Finite poset containing 6 elements
    188     """
    189     deprecation(10998, "%s is deprecated, use Posets.%s instead!" % \
    190            ("SymmetricGroupWeakOrderPoset","SymmetricGroupWeakOrderPoset"))
    191     return Posets.SymmetricGroupWeakOrderPoset(*args, **kwds)
  • sage/combinat/posets/hasse_diagram.py

    diff --git a/sage/combinat/posets/hasse_diagram.py b/sage/combinat/posets/hasse_diagram.py
    a b  
    326326            [4]
    327327        """
    328328        outdegs = self.out_degree(labels=True)
    329         return [x for x in outdegs if outdegs[x]==0]
     329        return [x for x,d in outdegs.iteritems() if d==0]
    330330
    331331    def bottom(self):
    332332        """
     
    12521252            sage: H.is_join_semilattice()
    12531253            False
    12541254        """
    1255         try: 
     1255        try:
    12561256            self.join_matrix()
    12571257        except ValueError:
    12581258            return False
     
    12891289                    if mt[x][jn[y][z]]!=jn[mt[x][y]][mt[x][z]]: return False
    12901290        return True
    12911291
    1292     def is_distributive_lattice_fastest(self):
    1293         r"""
    1294         This function is deprecated and will be removed in a future
    1295         version of Sage. Please use ``self.is_distributive_lattice()``
    1296         instead.
    1297 
    1298         TESTS::
    1299 
    1300             sage: from sage.combinat.posets.hasse_diagram import HasseDiagram
    1301             sage: H = HasseDiagram({0:[1,3,2],1:[4],2:[4,5,6],3:[6],4:[7],5:[7],6:[7],7:[]})
    1302             sage: H.is_distributive_lattice_fastest()
    1303             doctest:1: DeprecationWarning: is_distributive_lattice_fastest is deprecated, use is_distributive_lattice instead!
    1304             See http://trac.sagemath.org/5918 for details.
    1305             False
    1306         """
    1307         from sage.misc.superseded import deprecation
    1308         deprecation(5918, "is_distributive_lattice_fastest is deprecated, use is_distributive_lattice instead!")
    1309         return self.is_distributive_lattice()
    1310 
    13111292    def is_complemented_lattice(self):
    13121293        r"""
    13131294        Returns ``True`` if ``self`` is the Hasse diagram of a
  • sage/combinat/posets/posets.py

    diff --git a/sage/combinat/posets/posets.py b/sage/combinat/posets/posets.py
    a b  
    23882388            sage: list(Posets.ChainPoset(3).antichains(element_constructor = set))
    23892389            [set([]), set([0]), set([1]), set([2])]
    23902390
    2391         .. note:: this function used to return a list; this change is
    2392             slightly backward incompatible; e.g. ``len(A)`` does not work.
    2393 
    23942391        .. note:: Internally, this uses
    23952392            :class:`sage.combinat.subsets_pairwise.PairwiseCompatibleSubsets`
    23962393            and :class:`SearchForest`. At this point, iterating
  • sage/combinat/skew_partition.py

    diff --git a/sage/combinat/skew_partition.py b/sage/combinat/skew_partition.py
    a b  
    483483                                G.add_edge(string, newstring)
    484484        return G
    485485
    486 
    487     def r_quotient(self, length):
    488       """
    489       This method is deprecated.
    490 
    491       EXAMPLES::
    492 
    493           sage: SkewPartition([[3, 3, 2, 1], [2, 1]]).r_quotient(2)
    494           doctest:1: DeprecationWarning: r_quotient is deprecated. Use quotient instead.
    495           See http://trac.sagemath.org/5790 for details.
    496           [[[3], []], [[], []]]
    497       """
    498       from sage.misc.superseded import deprecation
    499       deprecation(5790, 'r_quotient is deprecated. Use quotient instead.')
    500       return self.quotient(length)
    501 
    502486    def quotient(self, k):
    503487        """
    504488        The quotient map extended to skew partitions.