Skip to content

Commit

Permalink
Trac #16933: Remove deprecated code
Browse files Browse the repository at this point in the history
Remove code deprecated in #7983, #13109, #13605, #13192, #14063.

URL: http://trac.sagemath.org/16933
Reported by: aapitzsch
Ticket author(s): André Apitzsch
Reviewer(s): Jeroen Demeyer
  • Loading branch information
Release Manager authored and vbraun committed Oct 14, 2014
2 parents 36c150e + cf77bc2 commit 599d03e
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 354 deletions.
54 changes: 0 additions & 54 deletions src/sage/combinat/composition.py
Expand Up @@ -1943,60 +1943,6 @@ def __iter__(self):
for c in Compositions_n(self.n-i):
yield self.element_class(self, [i]+list(c))

def from_descents(descents, nps=None):
r"""
This has been deprecated in :trac:`14063`. Use
:meth:`Compositions.from_descents()` instead.
EXAMPLES::
sage: [x-1 for x in Composition([1, 1, 3, 4, 3]).to_subset()]
[0, 1, 4, 8]
sage: sage.combinat.composition.from_descents([1,0,4,8],12)
doctest:...: DeprecationWarning: from_descents is deprecated. Use Compositions().from_descents instead.
See http://trac.sagemath.org/14063 for details.
[1, 1, 3, 4, 3]
"""
from sage.misc.superseded import deprecation
deprecation(14063, 'from_descents is deprecated. Use Compositions().from_descents instead.')
return Compositions().from_descents(descents, nps)

def composition_from_subset(S, n):
r"""
This has been deprecated in :trac:`14063`. Use
:meth:`Compositions.from_subset()` instead.
EXAMPLES::
sage: from sage.combinat.composition import composition_from_subset
sage: composition_from_subset([2,1,5,9], 12)
doctest:...: DeprecationWarning: composition_from_subset is deprecated. Use Compositions().from_subset instead.
See http://trac.sagemath.org/14063 for details.
[1, 1, 3, 4, 3]
"""
from sage.misc.superseded import deprecation
deprecation(14063, 'composition_from_subset is deprecated. Use Compositions().from_subset instead.')
return Compositions().from_subset(S, n)

def from_code(code):
r"""
This has been deprecated in :trac:`14063`. Use
:meth:`Compositions.from_code()` instead.
EXAMPLES::
sage: import sage.combinat.composition as composition
sage: Composition([4,1,2,3,5]).to_code()
[1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0]
sage: composition.from_code(_)
doctest:...: DeprecationWarning: from_code is deprecated. Use Compositions().from_code instead.
See http://trac.sagemath.org/14063 for details.
[4, 1, 2, 3, 5]
"""
from sage.misc.superseded import deprecation
deprecation(14063, 'from_code is deprecated. Use Compositions().from_code instead.')
return Compositions().from_code(code)

from sage.structure.sage_object import register_unpickle_override
register_unpickle_override('sage.combinat.composition', 'Composition_class', Composition)

148 changes: 3 additions & 145 deletions src/sage/combinat/partition.py
Expand Up @@ -411,70 +411,6 @@
notation = dict(alt_name='convention')
)

def from_frobenius_coordinates(coords):
"""
This function has been deprecated in :trac:`13605`. Use
:meth:`Partitions.from_frobenius_coordinates()` instead.
EXAMPLES::
sage: sage.combinat.partition.from_frobenius_coordinates(([],[]))
doctest:...: DeprecationWarning: from_frobenius_coordinates is deprecated. Use Partitions().from_frobenius_coordinates instead.
See http://trac.sagemath.org/13605 for details.
[]
"""
from sage.misc.superseded import deprecation
deprecation(13605, 'from_frobenius_coordinates is deprecated. Use Partitions().from_frobenius_coordinates instead.')
return _Partitions.from_frobenius_coordinates(coords)

def from_beta_numbers(beta):
"""
This function has been deprecated in :trac:`13605`. Use
:meth:`Partitions.from_beta_numbers()` instead.
EXAMPLES::
sage: sage.combinat.partition.from_beta_numbers([0,1,2,4,5,8])
doctest:...: DeprecationWarning: from_beta_numbers is deprecated. Use Partitions().from_beta_numbers instead.
See http://trac.sagemath.org/13605 for details.
[3, 1, 1]
"""
from sage.misc.superseded import deprecation
deprecation(13605, 'from_beta_numbers is deprecated. Use Partitions().from_beta_numbers instead.')
return _Partitions.from_beta_numbers(beta)

def from_exp(exp):
"""
This has been deprecated in :trac:`13605`. Use
:meth:`Partitions.from_exp()` instead.
EXAMPLES::
sage: sage.combinat.partition.from_exp([2,2,1])
doctest:...: DeprecationWarning: from_exp is deprecated. Use Partitions().from_exp instead.
See http://trac.sagemath.org/13605 for details.
[3, 2, 2, 1, 1]
"""
from sage.misc.superseded import deprecation
deprecation(13605, 'from_exp is deprecated. Use Partitions().from_exp instead.')
return _Partitions.from_exp(exp)

def from_core_and_quotient(core, quotient):
"""
This has been deprecated in :trac:`13605`. Use
:meth:`Partitions.from_core_and_quotient()` instead.
EXAMPLES::
sage: sage.combinat.partition.from_core_and_quotient([2,1], [[2,1],[3],[1,1,1]])
doctest:...: DeprecationWarning: from_core_and_quotient is deprecated. Use Partitions().from_core_and_quotient instead.
See http://trac.sagemath.org/13605 for details.
[11, 5, 5, 3, 2, 2, 2]
"""
from sage.misc.superseded import deprecation
deprecation(13605, 'from_core_and_quotient is deprecated. Use Partitions().from_core_and_quotient instead.')
return _Partitions.from_core_and_quotient(core, quotient)

class Partition(CombinatorialObject, Element):
r"""
A partition `p` of a nonnegative integer `n` is a
Expand Down Expand Up @@ -706,7 +642,7 @@ def __init__(self, parent, mu):
else:
raise ValueError("%s is not a valid partition"%repr(mu))

def _repr_(self, compact=False):
def _repr_(self, compact=None):
r"""
Return a string representation of ``self`` depending on
:meth:`Partitions.global_options`.
Expand Down Expand Up @@ -770,11 +706,9 @@ def _repr_(self, compact=False):
sage: Partitions.global_options.reset()
"""

if compact != False:
if compact is not None:
from sage.misc.superseded import deprecation
deprecation(13605, 'compact option is deprecated. Use :meth:`Partitions.global_options` instead.')
return self._repr_compact_high()
deprecation(16933, 'compact argument is deprecated.')

return self.parent().global_options.dispatch(self, '_repr_', 'display')

Expand Down Expand Up @@ -2739,21 +2673,6 @@ def attacking_pairs(self):

return attacking_pairs

def dominate(self, rows=None):
"""
Old name for :meth:`dominated_partitions()`.
EXAMPLES::
sage: Partition([3,2,1]).dominate()
doctest:...: DeprecationWarning: dominate is deprecated. Use dominated_partitions instead.
See http://trac.sagemath.org/13605 for details.
[[3, 2, 1], [3, 1, 1, 1], [2, 2, 2], [2, 2, 1, 1], [2, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1]]
"""
from sage.misc.superseded import deprecation
deprecation(13605, 'dominate is deprecated. Use dominated_partitions instead.')
return self.dominated_partitions(rows)

def dominated_partitions(self, rows=None):
"""
Return a list of the partitions dominated by `n`. If ``rows`` is
Expand Down Expand Up @@ -6460,22 +6379,6 @@ def list(self):

return [self.element_class(self, [x for x in p if x!=0]) for p in l]

def PartitionsInBox_hw(h, w):
"""
For unpickling ``PartitionsInBox_hw`` objects created before
:trac:`13605`. See :class:`OrderedPartitions`.
EXAMPLES::
sage: sage.combinat.partition.PartitionsInBox_hw(3, 2)
doctest:...: DeprecationWarning: this class is deprecated. Use PartitionsInBox instead
See http://trac.sagemath.org/13605 for details.
Integer partitions which fit in a 3 x 2 box
"""
from sage.misc.superseded import deprecation
deprecation(13605,'this class is deprecated. Use PartitionsInBox instead')
return PartitionsInBox(h, w)

class Partitions_constraints(IntegerListsLex):
"""
For unpickling old constrained ``Partitions_constraints`` objects created
Expand Down Expand Up @@ -6646,22 +6549,6 @@ def cardinality(self):
ans=gap.eval("NrOrderedPartitions(%s,%s)"%(n,k))
return ZZ(ans)

def OrderedPartitions_nk(n, k):
"""
For unpickling ``OrderedPartitions_nk`` objects created before
:trac:`13605`. See :class:`OrderedPartitions`.
EXAMPLES::
sage: sage.combinat.partition.OrderedPartitions_nk(3, 2)
doctest:...: DeprecationWarning: this class is deprecated. Use OrderedPartitions instead
See http://trac.sagemath.org/13605 for details.
Ordered partitions of 3 of length 2
"""
from sage.misc.superseded import deprecation
deprecation(13605,'this class is deprecated. Use OrderedPartitions instead')
return OrderedPartitions(n, k)

##########################
# Partitions Greatest LE #
##########################
Expand Down Expand Up @@ -6720,22 +6607,6 @@ def _repr_(self):
Element = Partition
global_options = PartitionOptions

def PartitionsGreatestLE_nk(n, k):
"""
For unpickling ``PartitionsGreatestLE`` objects created with sage <= 3.4.1.
See :class:`PartitionsGreatestLE`.
EXAMPLES::
sage: sage.combinat.partition.PartitionsGreatestLE_nk(10, 2)
doctest:...: DeprecationWarning: this class is deprecated. Use PartitionsGreatestLE instead
See http://trac.sagemath.org/13605 for details.
Partitions of 10 having parts less than or equal to 2
"""
from sage.misc.superseded import deprecation
deprecation(13605,'this class is deprecated. Use PartitionsGreatestLE instead')
return PartitionsGreatestLE(n, k)

##########################
# Partitions Greatest EQ #
##########################
Expand Down Expand Up @@ -6795,19 +6666,6 @@ def _repr_(self):
Element = Partition
global_options = PartitionOptions

def PartitionsGreatestEQ_nk(n, k):
"""
EXAMPLES::
sage: sage.combinat.partition.PartitionsGreatestEQ_nk(10, 2)
doctest:...: DeprecationWarning: this class is deprecated. Use PartitionsGreatestEQ instead
See http://trac.sagemath.org/13605 for details.
Partitions of 10 having greatest part equal to 2
"""
from sage.misc.superseded import deprecation
deprecation(13605,'this class is deprecated. Use PartitionsGreatestEQ instead')
return PartitionsGreatestEQ(n, k)

#########################
# Restricted Partitions #
#########################
Expand Down
7 changes: 3 additions & 4 deletions src/sage/combinat/partition_tuple.py
Expand Up @@ -484,7 +484,7 @@ def __len__(self):
"""
return self.level()

def _repr_(self, compact=False):
def _repr_(self, compact=None):
"""
Return a string representation of ``self`` depending on
:meth:`PartitionTuples.global_options`.
Expand Down Expand Up @@ -526,10 +526,9 @@ def _repr_(self, compact=False):
2, 1 | 3, 2 | 1^3
sage: PartitionTuples.global_options.reset()
"""
if compact:
if compact is not None:
from sage.misc.superseded import deprecation
deprecation(13605, 'compact option is deprecated. Use PartitionTuples.global_options instead.')
return self._repr_compact_high()
deprecation(16933, 'compact argument is deprecated.')

return self.parent().global_options.dispatch(self, '_repr_', 'display')

Expand Down
33 changes: 4 additions & 29 deletions src/sage/combinat/posets/posets.py
Expand Up @@ -1006,27 +1006,12 @@ def _element_constructor_(self, element):
sage: Q(5)
5
Accessing the n-th element of ``self`` as ``P(i)`` is deprecated::
Accessing the i-th element of ``self`` as ``P[i]``::
sage: P(5) == P(-1)
doctest:...: DeprecationWarning: Accessing the i-th element of a poset as P(i) is deprecated. Please use P[i]
See http://trac.sagemath.org/13109 for details.
sage: P = FinitePoset(DiGraph({'a':['b','c'], 'b':['d'], 'c':['d'], 'd':[]}), facade = False)
sage: P('a') == P[0]
True
sage: Q(5) == Q(-1)
True
sage: R = FinitePoset(DiGraph({'a':['b','c'], 'b':['d'], 'c':['d'], 'd':[]}), facade = False)
sage: R(0)
a
sage: R('a') == R(0)
True
sage: R('d') == R(-1)
True
Please use instead ``P[i]``::
sage: R('a') == R[0]
True
sage: R('d') == R[-1]
sage: P('d') == P[-1]
True
TESTS::
Expand All @@ -1041,16 +1026,6 @@ def _element_constructor_(self, element):
try:
return self._list[self._element_to_vertex_dict[element]]
except KeyError:
if isinstance(element,Integer):
from sage.misc.superseded import deprecation
deprecation(13109, "Accessing the i-th element of a poset as P(i) is deprecated. Please use P[i]")
if element > -1:
return self.element_class(self, \
self._elements[element], element)
else:
return self.element_class(self, \
self._elements[element], self.cardinality()+element)
else:
raise ValueError("%s is not an element of this poset"%type(element))

def __call__(self, element):
Expand Down
23 changes: 0 additions & 23 deletions src/sage/combinat/root_system/root_lattice_realizations.py
Expand Up @@ -1595,29 +1595,6 @@ def simple_projections(self, to_negative=True):
res.rename("pi")
return res

@lazy_attribute
def pi(self):
r"""
The simple projections of ``self``
.. seealso:: :meth:`simple_projections`
.. warning:: this shortcut is deprecated
EXAMPLES::
sage: space = RootSystem(['A',2]).weight_lattice()
sage: pi = space.pi
sage: x = space.simple_roots()
sage: pi[1](x[2])
-Lambda[1] + 2*Lambda[2]
"""
# _test_not_implemented_methods apparently evaluates all lazy
# attributes, which means that we can't use deprecation here!
# from sage.misc.superseded import deprecation
# deprecation(trac_number, "The lazy attribute pi is deprecated; please use the simple_projections method.")
return self.simple_projections()

##########################################################################
# Weyl group
##########################################################################
Expand Down

0 comments on commit 599d03e

Please sign in to comment.