Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 1c0d02d

Browse files
author
Travis Scrimshaw
committed
Merge branch 'public/combinat/poset/fix_equality-14019' of trac.sagemath.org:sage into public/combinat/poset/fix_equality-14019
2 parents c79991e + 3afec89 commit 1c0d02d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/sage/combinat/posets/posets.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ def Poset(data=None, element_labels=None, cover_relations=False, linear_extensio
492492
elements = None
493493
D = {}
494494
if isinstance(data, FinitePoset):
495-
if element_labels is None and category is None and facade is None and linear_extension == data._linear_extension:
495+
if element_labels is None and category is None and facade is None and linear_extension == data._with_linear_extension:
496496
return data
497497
if not linear_extension:
498498
P = FinitePoset(data, elements=None, category=category, facade=facade)
@@ -842,14 +842,14 @@ def __init__(self, hasse_diagram, elements, category, facade, key):
842842
"""
843843
Parent.__init__(self, category=category, facade=facade)
844844
if elements is None:
845-
self._linear_extension = False
845+
self._with_linear_extension = False
846846
# Compute a linear extension of the poset (a topological sort).
847847
try:
848848
elements = tuple(hasse_diagram.topological_sort())
849849
except Exception:
850850
raise ValueError("Hasse diagram contains cycles")
851851
else:
852-
self._linear_extension = True
852+
self._with_linear_extension = True
853853
# Work around the fact that, currently, when a DiGraph is
854854
# created with Integer's as vertices, those vertices are
855855
# converted to plain int's. This is a bit abusive.
@@ -3051,7 +3051,7 @@ def dual(self):
30513051
sage: P.dual().__class__
30523052
<class 'sage.combinat.posets.lattices.FiniteMeetSemilattice_with_category'>
30533053
"""
3054-
if self._linear_extension:
3054+
if self._with_linear_extension:
30553055
elements = reversed(self._elements)
30563056
else:
30573057
elements = None
@@ -3146,7 +3146,7 @@ def relabel(self, relabeling):
31463146
if isinstance(relabeling, dict):
31473147
relabeling = relabeling.__getitem__
31483148
relabeling = {i: relabeling(x) for i,x in enumerate(self._elements)}
3149-
if not self._linear_extension:
3149+
if not self._with_linear_extension:
31503150
elements = None
31513151
else:
31523152
elements = tuple(relabeling[self._element_to_vertex(x)]
@@ -3207,7 +3207,7 @@ def canonical_label(self):
32073207
sage: Q.cover_relations()
32083208
[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9]]
32093209
"""
3210-
P = Poset(DiGraph(self._hasse_diagram).canonical_label(), linear_extension=self._linear_extension,
3210+
P = Poset(DiGraph(self._hasse_diagram).canonical_label(), linear_extension=self._with_linear_extension,
32113211
category=self.category(), facade=self._is_facade)
32123212
return P.relabel(range(len(self._elements)))
32133213

0 commit comments

Comments
 (0)