sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.38k stars 470 forks source link

5 internet doctests failing in oeis #34609

Closed seblabbe closed 2 years ago

seblabbe commented 2 years ago

With 9.8.beta0, the command

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

returns

Using --optional=internet,sage
Features to be detected: 4ti2,benzene,bliss,buckygen,conway_polynomials,csdp,database_cremona_ellcurve,database_cremona_mini_ellcurve,database_cubic_hecke,database_jones_numfield,database_knotinfo,dvipng,gfan,graphviz,imagemagick,jupymake,kenzo,latte_int,lrslib,mcqd,meataxe,msolve,nauty,palp,pandoc,pdf2svg,pdftocairo,phitigra,plantri,polytopes_db,polytopes_db_4d,pynormaliz,python_igraph,rubiks,sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.groups,sage.misc.cython,sage.plot,sage.rings.number_field,sage.rings.padics,sage.rings.real_double,sage.symbolic,sage_numerical_backends_coin,sagemath_doc_html,sphinx,tdlib
Doctesting 1 file.
sage -t --random-seed=207643000931643346029156020826272169492 src/sage/databases/oeis.py
**********************************************************************
File "src/sage/databases/oeis.py", line 31, in sage.databases.oeis
Failed example:
    search = oeis([3, 7, 15, 1], max_results=4) ; search  # optional -- internet
Expected:
    0: A001203: Simple continued fraction expansion of Pi.
    1: A240698: Partial sums of divisors of n, cf. A027750.
    2: A082495: a(n) = (2^n - 1) mod n.
    3: A165416: Irregular array read by rows: The n-th row contains those distinct positive integers that each, when written in binary, occurs as a substring in binary n.
Got:
    0: A001203: Simple continued fraction expansion of Pi.
    1: A165416: Irregular array read by rows: The n-th row contains those distinct positive integers that each, when written in binary, occurs as a substring in binary n.
    2: A240698: Partial sums of divisors of n, cf. A027750.
    3: A246674: Run Length Transform of A000225.
**********************************************************************
File "src/sage/databases/oeis.py", line 37, in sage.databases.oeis
Failed example:
    [u.id() for u in search]                      # optional -- internet
Expected:
    ['A001203', 'A240698', 'A082495', 'A165416']
Got:
    ['A001203', 'A165416', 'A240698', 'A246674']
**********************************************************************
File "src/sage/databases/oeis.py", line 352, in sage.databases.oeis.OEIS
Failed example:
    oeis('prime gap factorization', max_results=4) # optional --internet
Expected:
    0: A073491: Numbers having no prime gaps in their factorization.
    1: A073485: Product of any number of consecutive primes; squarefree numbers with no gaps in their prime factorization.
    2: A073490: Number of prime gaps in factorization of n.
    3: A073492: Numbers having at least one prime gap in their factorization.
Got:
    0: A073491: Numbers having no prime gaps in their factorization.
    1: A286470: a(n) = maximal gap between indices of successive primes in the prime factorization of n.
    2: A073492: Numbers having at least one prime gap in their factorization.
    3: A073485: Product of any number of consecutive primes; squarefree numbers with no gaps in their prime factorization.
**********************************************************************
File "src/sage/databases/oeis.py", line 493, in sage.databases.oeis.OEIS.find_by_description
Failed example:
    prime_gaps = _[2] ; prime_gaps        # optional -- internet
Expected:
    A073490: Number of prime gaps in factorization of n.
Got:
    A073492: Numbers having at least one prime gap in their factorization.
**********************************************************************
File "src/sage/databases/oeis.py", line 538, in sage.databases.oeis.OEIS.find_by_subsequence
Failed example:
    oeis.find_by_subsequence([2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377])  # optional -- internet
Expected:
    0: A000045: Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.
    1: A212804: Expansion of (1 - x)/(1 - x - x^2).
    2: A020695: Pisot sequence E(2,3).
Got:
    0: A000045: Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.
    1: A212804: Expansion of (1 - x)/(1 - x - x^2).
    2: A324969: Number of unlabeled rooted identity trees with n vertices whose non-leaf terminal subtrees are all different.
**********************************************************************
4 items had failures:
   2 of  26 in sage.databases.oeis
   1 of  20 in sage.databases.oeis.OEIS
   1 of   5 in sage.databases.oeis.OEIS.find_by_description
   1 of   3 in sage.databases.oeis.OEIS.find_by_subsequence
    [289 tests, 5 failures, 37.42 s]
----------------------------------------------------------------------
sage -t --random-seed=207643000931643346029156020826272169492 src/sage/databases/oeis.py  # 5 doctests failed
----------------------------------------------------------------------

Component: doctest coverage

Author: Sébastien Labbé

Branch/Commit: e9b1f02

Reviewer: David Coudert

Issue created by migration from https://trac.sagemath.org/ticket/34609

seblabbe commented 2 years ago

Author: Sébastien Labbé

seblabbe commented 2 years ago

Commit: e9b1f02

seblabbe commented 2 years ago

Branch: u/slabbe/34609

seblabbe commented 2 years ago

New commits:

e9b1f0234609: fix doctests failures with oeis
dcoudert commented 2 years ago
comment:2

I agree with your proposal. We fixed some issues in #32695, but we knew it was not robust to changes in the database.

dcoudert commented 2 years ago

Reviewer: David Coudert

vbraun commented 2 years ago

Changed branch from u/slabbe/34609 to e9b1f02