Ticket #12697 (new enhancement)
Wrap T. Lecroq string processing C library as experimental package
| Reported by: | hivert | Owned by: | sage-combinat |
|---|---|---|---|
| Priority: | major | Milestone: | sage-5.10 |
| Component: | combinatorics | Keywords: | |
| Cc: | slabbe, saliola, vdelecroix, lecroq | Work issues: | |
| Report Upstream: | N/A | Reviewers: | |
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description (last modified by hivert) (diff)
See http://igm.univ-mlv.fr/~mac/CHL/CHL.html
How to install the wrapper
- install the spkg:
sage -f http://trac.sagemath.org/sage_trac/raw-attachment/ticket/12697/string_process-1.0.spkg
- install the patch:
cd $SAGE_ROOT/devel/sage hg qinit hg qimport http://trac.sagemath.org/sage_trac/raw-attachment/ticket/12697/trac_12697-string_process-fh.patch hg push sage -b
The wrapper should be installed.
Attachments
Change History
Changed 14 months ago by nthiery
-
attachment
string_process-1.0.spkg
added
comment:5 Changed 9 months ago 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?

Very preliminary version of spkg