Opened 14 months ago

Closed 14 months ago

Last modified 14 months ago

#26473 closed enhancement (fixed)

py3: fix doctests failures of sage/combinat/words/word_*datatype*

Reported by: slabbe Owned by:
Priority: major Milestone: sage-8.5
Component: python3 Keywords:
Cc: Merged in:
Authors: Sébastien Labbé Reviewers: Vincent Klein
Report Upstream: N/A Work issues:
Branch: b541ed5 (Commits) Commit: b541ed5cebb0a4aac7de1408501c082a515f14cb
Dependencies: Stopgaps:

Description (last modified by slabbe)

with 8.4.rc0, the python 3 failures in sage/combinat/words are:

----------------------------------------------------------------------
sage -t abstract_word.py  # 13 doctests failed
sage -t word_char.pyx  # 3 doctests failed
sage -t word_generators.py  # 23 doctests failed
sage -t word_infinite_datatypes.py  # 22 doctests failed
sage -t words.py  # 7 doctests failed
sage -t word.py  # 8 doctests failed
sage -t word_datatypes.pyx  # 1 doctest failed
sage -t suffix_trees.py  # 2 doctests failed
sage -t morphism.py  # 16 doctests failed
sage -t finite_word.py  # 73 doctests failed
sage -t paths.py  # 15 doctests failed
----------------------------------------------------------------------

often of the following form due to word_infinite_datatypes.py:

**********************************************************************
File "word_infinite_datatypes.py", line 1035, in sage.combinat.words.word_infinite_datatypes.WordDatatype_iter_with_caching.__getitem__
Failed example:
    w[::2]
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage3/local/lib/python3.6/site-packages/sage/doctest/forker.py", line 659, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage3/local/lib/python3.6/site-packages/sage/doctest/forker.py", line 1070, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.combinat.words.word_infinite_datatypes.WordDatatype_iter_with_caching.__getitem__[17]>", line 1, in <module>
        w[::Integer(2)]
      File "/home/slabbe/GitBox/sage3/local/lib/python3.6/site-packages/sage/combinat/words/word_infinite_datatypes.py", line 1161, in __getitem__
        return super(WordDatatype_iter_with_caching,self).__getitem__(key)
      File "/home/slabbe/GitBox/sage3/local/lib/python3.6/site-packages/sage/combinat/words/word_infinite_datatypes.py", line 874, in __getitem__
        data = itertools.islice(self, key.start, stop, key.step)
    ValueError: Step for islice() must be a positive integer or None.
**********************************************************************

We fix issues in word_infinite_datatypes.py and word_datatype.py and now with this ticket, there are a lot less failing doctests in sage/combinat/words:

----------------------------------------------------------------------
sage -t abstract_word.py  # 4 doctests failed
sage -t word_generators.py  # 2 doctests failed
sage -t word.py  # 1 doctest failed
sage -t morphism.py  # 9 doctests failed
sage -t finite_word.py  # 7 doctests failed
----------------------------------------------------------------------

Change History (13)

comment:1 Changed 14 months ago by slabbe

  • Branch set to u/slabbe/26473
  • Commit set to cf2f1c575906667b2269fc7d01d5ea18ff80fcba
  • Status changed from new to needs_review

New commits:

cf2f1c526473: py3 fix doctests of word_datatypes

comment:2 Changed 14 months ago by slabbe

  • Description modified (diff)

comment:3 Changed 14 months ago by git

  • Commit changed from cf2f1c575906667b2269fc7d01d5ea18ff80fcba to 9c851be1ebcf31e7623591b273d1d18684b12032

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

9c851be26473: py3 fix doctests of combinat/words/words.py

comment:4 Changed 14 months ago by slabbe

  • Status changed from needs_review to needs_work

I am still working on it ...

comment:5 Changed 14 months ago by git

  • Commit changed from 9c851be1ebcf31e7623591b273d1d18684b12032 to 2a3e7c6feed6a99907ca5a3efd201add9333e752

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

2a3e7c626473: py3 fix some doctests of combinat/words/word_generators.py

comment:6 Changed 14 months ago by git

  • Commit changed from 2a3e7c6feed6a99907ca5a3efd201add9333e752 to b541ed5cebb0a4aac7de1408501c082a515f14cb

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

b541ed526473: py3 fix some doctests of combinat/words/finite_word.py

comment:7 Changed 14 months ago by slabbe

  • Description modified (diff)

New commits:

2a3e7c626473: py3 fix some doctests of combinat/words/word_generators.py
b541ed526473: py3 fix some doctests of combinat/words/finite_word.py

comment:8 Changed 14 months ago by slabbe

  • Authors set to Sébastien Labbé
  • Status changed from needs_work to needs_review

comment:9 Changed 14 months ago by vklein

  • Owner changed from (none) to vklein

comment:10 Changed 14 months ago by vklein

  • Owner changed from vklein to (none)
  • Reviewers set to Vincent Klein

comment:11 Changed 14 months ago by vklein

  • Status changed from needs_review to positive_review

Looks good to me.

Pyflakes complaints are unrelated with this ticket modification.

Thanks.

Version 0, edited 14 months ago by vklein (next)

comment:12 Changed 14 months ago by vbraun

  • Branch changed from u/slabbe/26473 to b541ed5cebb0a4aac7de1408501c082a515f14cb
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:13 Changed 14 months ago by embray

  • Milestone changed from sage-8.4 to sage-8.5

This should be re-targeted for 8.5.

Note: See TracTickets for help on using tickets.