Skip to content

Commit fb6ecfe

Browse files
author
Release Manager
committed
sagemathgh-40942: provide an alias number_of_relations fix sagemath#40935 in posets as with sagemath#40939: we have to decide whether this does not pollute the name space too much. URL: sagemath#40942 Reported by: Martin Rubey Reviewer(s): Frédéric Chapoton
2 parents 040d852 + cd2aae5 commit fb6ecfe

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/sage/categories/finite_coxeter_groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def bhz_poset(self):
291291
sage: W = CoxeterGroup(['A',3], base_ring=ZZ)
292292
sage: P = W.bhz_poset(); P
293293
Finite poset containing 24 elements
294-
sage: P.relations_number()
294+
sage: P.number_of_relations()
295295
103
296296
sage: P.chain_polynomial()
297297
34*q^4 + 90*q^3 + 79*q^2 + 24*q + 1

src/sage/combinat/posets/posets.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
:meth:`~FinitePoset.cardinality` | Return the number of elements in the poset.
6666
:meth:`~FinitePoset.height` | Return the number of elements in a longest chain of the poset.
6767
:meth:`~FinitePoset.width` | Return the number of elements in a longest antichain of the poset.
68-
:meth:`~FinitePoset.relations_number` | Return the number of relations in the poset.
68+
:meth:`~FinitePoset.number_of_relations` | Return the number of relations in the poset.
6969
:meth:`~FinitePoset.dimension` | Return the dimension of the poset.
7070
:meth:`~FinitePoset.jump_number` | Return the jump number of the poset.
7171
:meth:`~FinitePoset.magnitude` | Return the magnitude of the poset.
@@ -2339,7 +2339,7 @@ def relations(self):
23392339
23402340
.. SEEALSO::
23412341
2342-
:meth:`relations_number`, :meth:`relations_iterator`
2342+
:meth:`number_of_relations`, :meth:`relations_iterator`
23432343
23442344
TESTS::
23452345
@@ -2693,7 +2693,7 @@ def relations_iterator(self, strict=False):
26932693
26942694
.. SEEALSO::
26952695
2696-
:meth:`relations_number`, :meth:`relations`.
2696+
:meth:`number_of_relations`, :meth:`relations`.
26972697
26982698
AUTHOR:
26992699
@@ -2711,7 +2711,7 @@ def relations_iterator(self, strict=False):
27112711
for j in hd.breadth_first_search(i):
27122712
yield [elements[i], elements[j]]
27132713

2714-
def relations_number(self):
2714+
def number_of_relations(self):
27152715
r"""
27162716
Return the number of relations in the poset.
27172717
@@ -2724,10 +2724,10 @@ def relations_number(self):
27242724
EXAMPLES::
27252725
27262726
sage: P = posets.PentagonPoset()
2727-
sage: P.relations_number()
2727+
sage: P.number_of_relations()
27282728
13
27292729
2730-
sage: posets.TamariLattice(4).relations_number()
2730+
sage: posets.TamariLattice(4).number_of_relations()
27312731
68
27322732
27332733
.. SEEALSO::
@@ -2736,13 +2736,15 @@ def relations_number(self):
27362736
27372737
TESTS::
27382738
2739-
sage: Poset().relations_number()
2739+
sage: Poset().number_of_relations()
27402740
0
27412741
"""
27422742
return sum(1 for _ in self.relations_iterator())
27432743

27442744
# Maybe this should also be deprecated.
2745-
intervals_number = relations_number
2745+
intervals_number = number_of_relations
2746+
2747+
relations_number = number_of_relations
27462748

27472749
def linear_intervals_count(self) -> list[int]:
27482750
"""

0 commit comments

Comments
 (0)