#12697: Wrap T. Lecroq string processing C library as experimental package
---------------------------------+------------------------------------------
Reporter: hivert | Owner: sage-combinat
Type: enhancement | Status: new
Priority: major | Milestone: sage-5.3
Component: combinatorics | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------
Comment (by slabbe):
Hi Nicolas, Florent, Thierry,
I just tested the installation of the spkg on sage-5.2 (running max osx
10.5.8). The spkg installed fine. Florent's patch works fine as well.
Thanks for doing the spkg. It seems so easy just running {{{sage -f}}}.
I get the following doctest errors :
{{{
sage -t "devel/sage-slabbe/sage/libs/string_process/string_process.pyx"
16
**********************************************************************
File "/Users/slabbe/Applications/sage-5.2/devel/sage-
slabbe/sage/libs/string_process/string_process.pyx", line 18:
sage: first_occurence_boyer_moore("dolor", text)
Expected:
12
Got nothing
**********************************************************************
File "/Users/slabbe/Applications/sage-5.2/devel/sage-
slabbe/sage/libs/string_process/string_process.pyx", line 24:
sage: occurences = all_occurences_boyer_moore("in", text); occurences
Exception raised:
Traceback (most recent call last):
File "/Users/slabbe/Applications/sage-5.2/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/slabbe/Applications/sage-5.2/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/Users/slabbe/Applications/sage-5.2/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_0[5]>", line 1, in <module>
occurences = all_occurences_boyer_moore("in", text);
occurences###line 24:
sage: occurences = all_occurences_boyer_moore("in", text); occurences
NameError: name 'all_occurences_boyer_moore' is not defined
**********************************************************************
File "/Users/slabbe/Applications/sage-5.2/devel/sage-
slabbe/sage/libs/string_process/string_process.pyx", line 29:
sage: type(occurences)
Exception raised:
Traceback (most recent call last):
File "/Users/slabbe/Applications/sage-5.2/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/slabbe/Applications/sage-5.2/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/Users/slabbe/Applications/sage-5.2/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_0[6]>", line 1, in <module>
type(occurences)###line 29:
sage: type(occurences)
NameError: name 'occurences' is not defined
**********************************************************************
File "/Users/slabbe/Applications/sage-5.2/devel/sage-
slabbe/sage/libs/string_process/string_process.pyx", line 34:
sage: len(occurences)
Exception raised:
Traceback (most recent call last):
File "/Users/slabbe/Applications/sage-5.2/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/slabbe/Applications/sage-5.2/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/Users/slabbe/Applications/sage-5.2/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_0[7]>", line 1, in <module>
len(occurences)###line 34:
sage: len(occurences)
NameError: name 'occurences' is not defined
**********************************************************************
File "/Users/slabbe/Applications/sage-5.2/devel/sage-
slabbe/sage/libs/string_process/string_process.pyx", line 36:
sage: occurences[0]
Exception raised:
Traceback (most recent call last):
File "/Users/slabbe/Applications/sage-5.2/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/slabbe/Applications/sage-5.2/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/Users/slabbe/Applications/sage-5.2/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_0[8]>", line 1, in <module>
occurences[Integer(0)]###line 36:
sage: occurences[0]
NameError: name 'occurences' is not defined
**********************************************************************
File "/Users/slabbe/Applications/sage-5.2/devel/sage-
slabbe/sage/libs/string_process/string_process.pyx", line 51:
sage: b = border_array(u3); b
Expected:
array([0, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7], dtype=int32)
Got:
array([0, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7])
**********************************************************************
File "/Users/slabbe/Applications/sage-5.2/devel/sage-
slabbe/sage/libs/string_process/string_process.pyx", line 53:
sage: b[0] = 4; b
Expected:
array([4, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7], dtype=int32)
Got:
array([4, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7])
**********************************************************************
1 items had failures:
7 of 18 in __main__.example_0
***Test Failed*** 7 failures.
For whitespace errors, see the file
/Users/slabbe/.sage//tmp/string_process_50240.py
[3.5 s]
----------------------------------------------------------------------
The following tests failed:
sage -t "devel/sage-
slabbe/sage/libs/string_process/string_process.pyx"
Total time for all tests: 3.5 seconds
}}}
Question 1
Also, I've never work with the directory {{{sage/libs}}} before. Should
all function using the spkg should be there? Can other functions be
elsewhere like in {{{sage/combinat/words}}} ?
Question 2
What is the goal of this ticket? Make the spkg as optional? Merge
Florent's patch into Sage?
Question 3
Nicolas, you say the spkg is very preliminary. What are the next
improvements that should be done?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12697#comment:5>
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.