Opened 4 years ago
Closed 4 years ago
#21078 closed defect (fixed)
failing doctest with TamariIntervalPosets_size
Reported by:  vdelecroix  Owned by:  

Priority:  blocker  Milestone:  sage7.3 
Component:  combinatorics  Keywords:  
Cc:  VivianePons, chapoton, tscrim, gchatel, kdilks  Merged in:  
Authors:  Vincent Delecroix  Reviewers:  Travis Scrimshaw 
Report Upstream:  N/A  Work issues:  
Branch:  878755a (Commits)  Commit:  878755a42decfd837b4ad1ad53613bd2045ef302 
Dependencies:  Stopgaps: 
Description
There is a failing doctest in sage/combinat/interval_posets.py
in sage7.3.beta9
sage: from sage.combinat.interval_posets import TamariIntervalPosets_size sage: for i in xrange(6): TestSuite(TamariIntervalPosets_size(i)).run()  The following tests failed: _test_cardinality Failure in _test_cardinality: Traceback (most recent call last): File "/opt/sage/local/lib/python2.7/sitepackages/sage/misc/sage_unittest.py", line 283, in run test_method(tester = tester) File "/opt/sage/local/lib/python2.7/sitepackages/sage/categories/sets_cat.py", line 1410, in _test_cardinality "the output of the method cardinality must either be a Sage integer or infinity. Not {}.".format(type(cardinality))) File "/opt/sage/local/lib/python/unittest/case.py", line 424, in assertTrue raise self.failureException(msg) AssertionError: the output of the method cardinality must either be a Sage integer or infinity. Not <type 'int'>.  The following tests failed: _test_cardinality
Change History (13)
comment:1 Changed 4 years ago by
 Summary changed from failing doctest in TamariIntervalPosets_size to failing doctest with TamariIntervalPosets_size
comment:2 Changed 4 years ago by
 Cc andrew.mathas added
comment:3 Changed 4 years ago by
 Cc gchatel kdilks added; andrew.mathas removed
comment:4 Changed 4 years ago by
I can't reproduce. #20921 seems related.
comment:5 Changed 4 years ago by
2/3 patchbots are able to reproduce it
may be related to the fact that coxeter3 is present... I don't know.
comment:6 Changed 4 years ago by
Note that the failure is order dependent because of UniqueRepresentation
that thinks that Sage Integer 1 is the same as Python int 1.
sage: from sage.combinat.interval_posets import TamariIntervalPosets_size sage: T1 = TamariIntervalPosets_size(1) sage: T2 = TamariIntervalPosets_size(1r) sage: print (parent(T1._size), parent(T2._size)) (Integer Ring, Integer Ring)
vs
sage: from sage.combinat.interval_posets import TamariIntervalPosets_size sage: T2 = TamariIntervalPosets_size(1r) sage: T1 = TamariIntervalPosets_size(1) sage: print (parent(T1._size), parent(T2._size)) (<type 'int'>, <type 'int'>)
comment:7 Changed 4 years ago by
It seems like the best solution is probably to make sure the output of cardinality()
is in ZZ
.
comment:8 Changed 4 years ago by
It will automatically the case if the attribute _size
is itself an Integer
.
comment:9 Changed 4 years ago by
 Branch set to u/vdelecroix/21078
 Commit set to 878755a42decfd837b4ad1ad53613bd2045ef302
 Status changed from new to needs_review
New commits:
878755a  Trac 21078: fix poset doctest

comment:10 Changed 4 years ago by
 Reviewers set to Travis Scrimshaw
 Status changed from needs_review to positive_review
I think this is a better test too. Thanks. (Also sorry for not doing it myself; I've been traveling the past few days.)
comment:11 Changed 4 years ago by
The previous doctest was actually a mistake. The __clascall_private__
is not inherited.
comment:12 Changed 4 years ago by
Thanks for the review!
comment:13 Changed 4 years ago by
 Branch changed from u/vdelecroix/21078 to 878755a42decfd837b4ad1ad53613bd2045ef302
 Resolution set to fixed
 Status changed from positive_review to closed
probably due to #20240