Closed malb closed 14 years ago
Burcin, I just replaced the patch to fix a doctest failure.
Btw. this also works now:
sage: from sage.libs.singular.function import singular_function, lib
sage: groebner = singular_function('groebner')
sage: groebner?
Type: SingularLibraryFunction
Base Class: <type 'sage.libs.singular.function.SingularLibraryFunction'>
String Form: groebner (singular function)
Namespace: Interactive
File: /usr/local/sage-4.1/local/lib/python2.6/site-packages/sage/libs/singular/function.so
Docstring:
groebner
--------
Procedure from library `standard.lib' (*note standard_lib::).
*Syntax:*
`groebner (' ideal_expression `)'
`groebner (' module_expression `)'
`groebner (' ideal_expression`,' int_expression `)'
`groebner (' module_expression`,' int_expression `)'
...
Hi! It looks very promosing. However, I have difficulties to apply the patch. Using sage-4.1.0 and the updated singular spkg:
I tried it with and without the refactoring patch, also using a fresh installation:
sage -hg import ~/Downloads/libsingular_functions.patch
applying /Users/michael/Downloads/libsingular_functions.patch
patching file module_list.py
Hunk #1 FAILED at 441
1 out of 1 hunks FAILED -- saving rejects to file module_list.py.rej
unable to find 'sage/libs/singular/polynomial.pyx' for patching
1 out of 1 hunks FAILED -- saving rejects to file sage/libs/singular/polynomial.pyx.rej
patching file sage/libs/singular/singular-cdefs.pxi
Hunk #3 FAILED at 207
Hunk #4 succeeded at 215 with fuzz 2 (offset -43 lines).
Hunk #7 FAILED at 853
2 out of 7 hunks FAILED -- saving rejects to file sage/libs/singular/singular-cdefs.pxi.rej
patching file sage/libs/singular/singular.pxd
Hunk #1 FAILED at 0
Hunk #2 FAILED at 26
2 out of 2 hunks FAILED -- saving rejects to file sage/libs/singular/singular.pxd.rej
patching file sage/libs/singular/singular.pyx
Hunk #1 FAILED at 24
Hunk #2 succeeded at 514 with fuzz 2 (offset -15 lines).
Hunk #3 FAILED at 593
2 out of 3 hunks FAILED -- saving rejects to file sage/libs/singular/singular.pyx.rej
patching file sage/rings/polynomial/multi_polynomial_libsingular.pyx
Hunk #1 FAILED at 1906
Hunk #2 FAILED at 2019
2 out of 2 hunks FAILED -- saving rejects to file sage/rings/polynomial/multi_polynomial_libsingular.pyx.rej
Michael
Hi Michael, this is strange, here is what works for me
hg qimport https://github.com/sagemath/sage-prod/files/10645648/libsingular_refactoring.patch.gz
hg qimport https://github.com/sagemath/sage-prod/files/10645704/libsingular_functions.patch.gz
sage -b
I have no failed hunks etc. with that.
I am happy with the refactoring of my code :-). I played with it and I like it. From the Singular side, this nontrivial patch looks fine.
Here some different timings with even better factor: opposite kind of example: very tiny input, output and almost nothing to compute, replaces some singular interpreter call via pexpect with libsingular kernel function call
from sage.libs.singular import function as sf
intersect=sf.SingularKernelFunction("intersect")
sage: P.<x,y,z>=QQ[]
sage: j=P.ideal(x,z)
sage: i=P.ideal(x,y)
sage: timeit("z=i.intersection(j)")
125 loops, best of 3: 5.12 ms per loop
sage: timeit("z=intersect(i,j)")
625 loops, best of 3: 60.9 µs per loop
It seems this patch makes docbuild choke because
groebner
--------
is contained in one docstring.
fixed in updated patch.
On IRC:
[13:02] <mvngu> malb: The package singular-3-1-0-4-20090723.spkg compiles OK on t2!
Attachment: libsingular_functions.patch.gz
fixing docstring issue
Attachment: trac_6628-referee.patch.gz
apply after the previous patch
This stuff is great! I've attached a small referee patch that fixes some very minor typos.
I will note that line 280 of singular-cdefs.pxi
is not entirely confidence-inspiring, but I believe the best way to test and refine this stuff is to get it into Sage and start using it a lot.
Note to the release manager: as pointed out above, one must first merge the new Singular spkg, and the patch(es) at #6596.
Reviewer: Alex Ghitza
The referee patch looks good. I think the next step would be to port stuff in multi_polynomial_ideal.py
to use this new stuff and see what happens.
Replying to @malb:
The referee patch looks good. I think the next step would be to port stuff in
multi_polynomial_ideal.py
to use this new stuff and see what happens.
Indeed. I'm expecting awesomeness (more Singular functionality readily exposed in Sage), speed, and the occasional bug fix.
I'll try to have a look at #6596 soon, but it's a bit bigger, and it will probably take a few days.
regarding 280: I was a little bit confused, as I thought it would be the same type in idrec and sleftv. But it's indeed void* in sleftv, so the code is correct, but the comment is wrong. Nothing dangerous, you can remove the warning. Michael
Merged: Sage 4.1.2.alpha0
Merged both patches.
The attached patch implements the following:
For comparison, the Singular pexpect interface needs almost two seconds for the same task (due to string parsing on both ends, IPC, etc.)
This patch requires an updated Singular SPKG (see below).
CC: @burcin
Component: commutative algebra
Keywords: singular, libsingular, commutative algebra
Author: Michael Brickenstein, Martin Albrecht
Reviewer: Alex Ghitza
Merged: Sage 4.1.2.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/6628