Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#25472 closed defect (fixed)

18 internet doctests failed in databases/findstat.py

Reported by: slabbe Owned by:
Priority: major Milestone: sage-8.3
Component: combinatorics Keywords: findstat
Cc: stumpc5, mantepse, tscrim Merged in:
Authors: Martin Rubey Reviewers: Frédéric Chapoton
Report Upstream: N/A Work issues:
Branch: 22bc1a8 (Commits, GitHub, GitLab) Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by slabbe)

As reported on sage-release 8.3.beta3,

sage -t --optional=sage,internet src/sage/databases/findstat.py 

gives

Running doctests with ID 2018-05-30-22-42-48-bef308fa.
Using --optional=internet,sage
Doctesting 1 file.
sage -t --warn-long 82.7 src/sage/databases/findstat.py
**********************************************************************
File "src/sage/databases/findstat.py", line 39, in sage.databases.findstat
Failed example:
    r = findstat([(m, m.number_of_nestings()) for m in PM8]); r           # optional -- internet,random
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 562, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 972, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.databases.findstat[2]>", line 1, in <module>
        r = findstat([(m, m.number_of_nestings()) for m in PM8]); r           # optional -- internet,random
      File "sage/misc/lazy_import.pyx", line 354, in sage.misc.lazy_import.LazyImport.__call__ (build/cythonized/sage/misc/lazy_import.c:3756)
        return self.get_object()(*args, **kwds)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/databases/findstat.py", line 617, in __call__
        return query_by_iterable(query_1)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/databases/findstat.py", line 597, in query_by_iterable
        depth=depth)._find_by_values(max_values=max_values)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/databases/findstat.py", line 1032, in _find_by_values
        raise ValueError("After discarding elements not in the range, too few (=%s) values remained to send to FindStat." %in_range_counter)
    ValueError: After discarding elements not in the range, too few (=0) values remained to send to FindStat.
**********************************************************************
...

**********************************************************************
File "src/sage/databases/findstat.py", line 2799, in sage.databases.findstat.FindStatMaps
Failed example:
    for m in sorted(FindStatMaps(), key=lambda m: (m.domain(), m.codomain)):    # optional -- internet,random
        print(m.domain().name().ljust(30)+" "+m.codomain().name().ljust(30)+" "+m.name())
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 562, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 972, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.databases.findstat.FindStatMaps[1]>", line 1, in <module>
        for m in sorted(FindStatMaps(), key=lambda m: (m.domain(), m.codomain)):    # optional -- internet,random
      File "sage/structure/element.pyx", line 1106, in sage.structure.element.Element.__richcmp__ (build/cythonized/sage/structure/element.c:10059)
        return (<Element>self)._richcmp_(other, op)
      File "sage/structure/element.pyx", line 1110, in sage.structure.element.Element._richcmp_ (build/cythonized/sage/structure/element.c:10161)
        cpdef _richcmp_(left, right, int op):
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/databases/findstat.py", line 1954, in _richcmp_
        return richchmp(self.id(), other.id(), op)
    NameError: global name 'richchmp' is not defined
**********************************************************************
File "src/sage/databases/findstat.py", line 2875, in sage.databases.findstat.FindStatMaps.__iter__
Failed example:
    [m for m in FindStatMaps()][0]                                # optional -- internet
Expected:
    Mp00072: binary search tree: left to right
Got:
    Mp00124: Adin-Bagno-Roichman transformation
**********************************************************************
9 items had failures:
   6 of  16 in sage.databases.findstat
   1 of   4 in sage.databases.findstat.FindStatCollection.__reduce__
   5 of   9 in sage.databases.findstat.FindStatCollection._richcmp_
   1 of   5 in sage.databases.findstat.FindStatCollection.to_string
   1 of   3 in sage.databases.findstat.FindStatCollections
   1 of   4 in sage.databases.findstat.FindStatCollections.__init__
   1 of   3 in sage.databases.findstat.FindStatMaps
   1 of   3 in sage.databases.findstat.FindStatMaps.__iter__
   1 of   5 in sage.databases.findstat.FindStatStatistic.first_terms
    [228 tests, 18 failures, 131.85 s]
----------------------------------------------------------------------
sage -t --warn-long 82.7 src/sage/databases/findstat.py  # 18 doctests failed
----------------------------------------------------------------------
Total time for all tests: 132.0 seconds
    cpu time: 12.4 seconds
    cumulative wall time: 131.9 seconds

Full log on framabin

Change History (15)

comment:1 Changed 3 years ago by slabbe

  • Description modified (diff)

comment:2 Changed 3 years ago by tscrim

  • Cc stumpc5 mantepse tscrim added

comment:3 Changed 3 years ago by chapoton

the richcmp issue was fixed in #25411

comment:4 Changed 3 years ago by mantepse

  • Keywords findstat added

comment:5 Changed 3 years ago by mantepse

  • Branch set to u/mantepse/18_internet_doctests_failed_in_databases_findstat_py

comment:6 Changed 3 years ago by mantepse

  • Commit set to dca6838e54205918d59cf1e33db27958f2c452a1
  • Status changed from new to needs_review

New commits:

dca6838fix doctests and several minor bugs, update constants

comment:7 Changed 3 years ago by chapoton

__hash__ needs a doctest

Last edited 3 years ago by chapoton (previous) (diff)

comment:8 Changed 3 years ago by git

  • Commit changed from dca6838e54205918d59cf1e33db27958f2c452a1 to 22bc1a8aa5080e380ea74b8b9832a14798ac27d7

Branch pushed to git repo; I updated commit sha1. New commits:

22bc1a8add doctests for __hash__

comment:9 follow-up: Changed 3 years ago by stumpc5

-        verbose("Waiting a little before deleting the temporary file", caller_name='FindStat')
-        time.sleep(1)
-
-        f.unlink(f.name)

is this because we can just ignore files in the temp folder?

comment:10 in reply to: ↑ 9 Changed 3 years ago by mantepse

Replying to stumpc5:

-        verbose("Waiting a little before deleting the temporary file", caller_name='FindStat')
-        time.sleep(1)
-
-        f.unlink(f.name)

is this because we can just ignore files in the temp folder?

Yes. I asked on StackExchange?, and didn't get any useful answer. It's probably because I am obsessed with saving space.

comment:11 Changed 3 years ago by chapoton

  • Authors set to Martin Rubey
  • Reviewers set to Frédéric Chapoton
  • Status changed from needs_review to positive_review

ok

comment:12 Changed 3 years ago by mantepse

Thank you!

comment:13 Changed 3 years ago by vbraun

  • Branch changed from u/mantepse/18_internet_doctests_failed_in_databases_findstat_py to 22bc1a8aa5080e380ea74b8b9832a14798ac27d7
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:14 Changed 3 years ago by slabbe

  • Commit 22bc1a8aa5080e380ea74b8b9832a14798ac27d7 deleted

I get one more internet failure in findstat: #25773

comment:15 Changed 3 years ago by slabbe

I get three other internet failures in findstat: #26348

Note: See TracTickets for help on using tickets.