#8127: Wraps string features into WordDatatypes
---------------------------+------------------------------------------------
   Reporter:  vdelecroix   |       Owner:  vdelecroix  
       Type:  enhancement  |      Status:  new         
   Priority:  major        |   Milestone:  sage-4.3.2  
  Component:  algebra      |    Keywords:  string, word
     Author:  vdelecroix   |    Upstream:  N/A         
   Reviewer:               |      Merged:              
Work_issues:               |  
---------------------------+------------------------------------------------

Comment(by slabbe):

 With the patch applied, I obtain some doctest failures :


 {{{
 sage -t  "devel/sage-combinat/sage/combinat/words/morphism.py"
 **********************************************************************
 File "/Users/slabbe/Applications/sage-4.3.1/devel/sage-
 combinat/sage/combinat/words/morphism.py", line 485:
     sage: w = m('aaab',datatype='str')
 Exception raised:
     Traceback (most recent call last):
       File
 "/Users/slabbe/Applications/sage-4.3.1/local/bin/ncadoctest.py", line
 1231, in run_one_test
         self.run_one_example(test, example, filename, compileflags)
       File
 "/Users/slabbe/Applications/sage-4.3.1/local/bin/sagedoctest.py", line 38,
 in run_one_example
         OrigDocTestRunner.run_one_example(self, test, example, filename,
 compileflags)
       File
 "/Users/slabbe/Applications/sage-4.3.1/local/bin/ncadoctest.py", line
 1172, in run_one_example
         compileflags, 1) in test.globs
       File "<doctest __main__.example_8[28]>", line 1, in <module>
         w = m('aaab',datatype='str')###line 485:
     sage: w = m('aaab',datatype='str')
       File "/Users/slabbe/Applications/sage-4.3.1/local/lib/python/site-
 packages/sage/combinat/words/morphism.py", line 582, in __call__
         return self.codomain()((x for y in w for x in self._morph[y]),
 length=length, datatype=datatype)
       File "/Users/slabbe/Applications/sage-4.3.1/local/lib/python/site-
 packages/sage/combinat/words/words.py", line 272, in __call__
         self._check(w)
       File "/Users/slabbe/Applications/sage-4.3.1/local/lib/python/site-
 packages/sage/combinat/words/words.py", line 501, in _check
         for a in itertools.islice(w, length):
       File "word_datatypes.pyx", line 244, in
 sage.combinat.words.word_datatypes.WordDatatype_str.__iter__
 (sage/combinat/words/word_datatypes.cpp:1480)
         return iter(self._data)
     TypeError: 'NoneType' object is not iterable
 **********************************************************************
 File "/Users/slabbe/Applications/sage-4.3.1/devel/sage-
 combinat/sage/combinat/words/morphism.py", line 486:
     sage: type(w)
 Expected:
     <class 'sage.combinat.words.word.FiniteWord_str'>
 Got:
     <class 'sage.combinat.words.word.FiniteWord_list'>
 **********************************************************************
 File "/Users/slabbe/Applications/sage-4.3.1/devel/sage-
 combinat/sage/combinat/words/morphism.py", line 507:
     sage: w = m([0],4,datatype='str')
 Expected:
     Traceback (most recent call last):
     ...
     ValueError: 0 not in alphabet!
 Got:
     Traceback (most recent call last):
       File
 "/Users/slabbe/Applications/sage-4.3.1/local/bin/ncadoctest.py", line
 1231, in run_one_test
         self.run_one_example(test, example, filename, compileflags)
       File
 "/Users/slabbe/Applications/sage-4.3.1/local/bin/sagedoctest.py", line 38,
 in run_one_example
         OrigDocTestRunner.run_one_example(self, test, example, filename,
 compileflags)
       File
 "/Users/slabbe/Applications/sage-4.3.1/local/bin/ncadoctest.py", line
 1172, in run_one_example
         compileflags, 1) in test.globs
       File "<doctest __main__.example_8[37]>", line 1, in <module>
         w = m([Integer(0)],Integer(4),datatype='str')###line 507:
     sage: w = m([0],4,datatype='str')
       File "/Users/slabbe/Applications/sage-4.3.1/local/lib/python/site-
 packages/sage/combinat/words/morphism.py", line 586, in __call__
         return self(self(w, order-1),datatype=datatype)
       File "/Users/slabbe/Applications/sage-4.3.1/local/lib/python/site-
 packages/sage/combinat/words/morphism.py", line 582, in __call__
         return self.codomain()((x for y in w for x in self._morph[y]),
 length=length, datatype=datatype)
       File "/Users/slabbe/Applications/sage-4.3.1/local/lib/python/site-
 packages/sage/combinat/words/words.py", line 272, in __call__
         self._check(w)
       File "/Users/slabbe/Applications/sage-4.3.1/local/lib/python/site-
 packages/sage/combinat/words/words.py", line 501, in _check
         for a in itertools.islice(w, length):
       File "word_datatypes.pyx", line 244, in
 sage.combinat.words.word_datatypes.WordDatatype_str.__iter__
 (sage/combinat/words/word_datatypes.cpp:1480)
         return iter(self._data)
     TypeError: 'NoneType' object is not iterable
 **********************************************************************
 1 items had failures:
    3 of  48 in __main__.example_8
 ***Test Failed*** 3 failures.
 For whitespace errors, see the file
 /Users/slabbe/.sage//tmp/.doctest_morphism.py
          [3.6 s]
 exit code: 1024

 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8127#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to