Summary: | dev-python/numeric is not compatible with python-2.5 on 64bit arches | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Darren Dale <dsdale24> |
Component: | Current packages | Assignee: | Python Gentoo Team <python> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | anarchy, coldwind, delimy, denilsonsa, dsd, rmay31 |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 148333 | ||
Attachments: |
numarray fix
python 2.5 fix for numeric-24.2 |
Description
Darren Dale
2007-05-03 13:07:17 UTC
which version of numeric are you using? I can't reproduce it with numeric-24.2-r4 (which includes a fair amount of patches to the stable one) on my amd64 box. I am also using numeric-24.2-r4. It was fine with python-2.4, I only see the error with python-2.5 (specifically python-2.5-r2). Which python are you using? I am using python-2.4, you're right. I have not got the time to dig in python-2.5. Do all tests run fine? $ python test.py ......E.E...........E.........E.............. ====================================================================== ERROR: test concatenate ---------------------------------------------------------------------- Traceback (most recent call last): File "test.py", line 433, in testConcatenate assert_eq(Numeric.concatenate((self.a[:3], self.a[3:])), [0,1,2,3,4,5]) File "test.py", line 28, in assert_eq assert eq(a,b) File "test.py", line 24, in eq (aa.shape, a, ab.shape, b)) ValueError: sequences have different shapes: a(3,)=array([0, 1, 2]) b(6,)=[0, 1, 2, 3, 4, 5] ====================================================================== ERROR: Test the diagonal function. ---------------------------------------------------------------------- Traceback (most recent call last): File "test.py", line 584, in testDiagonal assert_eq(Numeric.diagonal(c,1), [[2,7,4], [2,7,4]]) File "test.py", line 28, in assert_eq assert eq(a,b) File "test.py", line 24, in eq (aa.shape, a, ab.shape, b)) ValueError: sequences have different shapes: a(4, 2)=array([[5, 1], [6, 2], [7, 3], [8, 4]]) b(2, 3)=[[2, 7, 4], [2, 7, 4]] ====================================================================== ERROR: Test of average function. ---------------------------------------------------------------------- Traceback (most recent call last): File "test.py", line 297, in testAverage c.shape=(3,2) ValueError: total size of new array must be unchanged ====================================================================== ERROR: Test slicing, like x[1:3] ---------------------------------------------------------------------- Traceback (most recent call last): File "test.py", line 141, in testSlice assert_eq(a[0:], a) File "test.py", line 28, in assert_eq assert eq(a,b) File "test.py", line 24, in eq (aa.shape, a, ab.shape, b)) ValueError: sequences have different shapes: a(0,)=zeros((0,), 'l') b(4,)=array([1, 2, 3, 4]) ---------------------------------------------------------------------- Ran 45 tests in 0.264s FAILED (errors=4) dev-lang/python-2.5.1-r2 dev-python/numeric-24.2-r4 even 32bit x86 couldn't pass all test: delimy@COIN Test $ python test.py ........E.................................... ====================================================================== ERROR: Test the diagonal function. ---------------------------------------------------------------------- Traceback (most recent call last): File "test.py", line 584, in testDiagonal assert_eq(Numeric.diagonal(c,1), [[2,7,4], [2,7,4]]) File "test.py", line 28, in assert_eq assert eq(a,b) File "test.py", line 24, in eq (aa.shape, a, ab.shape, b)) ValueError: sequences have different shapes: a(4, 2)=array([[5, 1], [6, 2], [7, 3], [8, 4]]) b(2, 3)=[[2, 7, 4], [2, 7, 4]] ---------------------------------------------------------------------- Ran 45 tests in 0.137s FAILED (errors=1) but the example above runs correctly. Hi, It gave me more work than I had thougth initially. Anyway, I produced some new patches for 2.5, which I tested on x86. I could not test them with python 2.5 on my amd64 box (they worked for 2.4). I put those patches on the gentooscience overlay (layman -a science). Please let me know if they also work on amd64 and any other arches you may test. Thanks Sébastien Well, it seems my patches don't do anything on amd64. I was thinking of masking it, but there are too many apps still depending on numeric. I will need more time than I can give on this package, so if anyone has an idea about it, it'd help a lot. Upstream won't do anything since it is discontinued. From the numeric website: Numeric was the first arrayobject built for Python. It has been quite successful and is used in a wide variety of settings and applications. Maintenance has ceased for Numeric, and users should transisition to NumPy as quickly as possible. There is a module called numpy.oldnumeric.alter_code1 in NumPy that can make the transition to NumPy easier (it will automatically perform the search-and-replace style changes that need to be made to python code that uses Numeric to make it work with NumPy). If porting to numpy is this easy, maybe we should just patch the programs that require numeric and remove it as a dependency. Created attachment 122841 [details, diff]
numarray fix
numarray has an almost identical problem (due to the int/size_t thing), which is fixed by this patch. Maybe it's useful for fixing numeric.
forgot to mention, credit for that patch goes to Todd Miller. (In reply to comment #8) > If porting to numpy is this easy, maybe we should just patch the programs that > require numeric and remove it as a dependency. We should work with upstream to migrate all packages. The migration will be neccessary at some point even if numeric is fixed. Packages using numeric are: dev-python/f2py dev-python/fonttools dev-python/gnuplot-py dev-python/matplotlib dev-python/pycairo dev-python/pyclimate dev-python/pygame dev-python/pygtk dev-python/pyqwt dev-python/python-biggles dev-python/rpy dev-python/scientificpython dev-python/ttfquery dev-python/visual games-arcade/pydance games-rpg/galaxymage gnome-extra/music-applet sci-biology/biopython sci-libs/plplot sci-libs/pymmlib sci-physics/camfr (In reply to comment #11) > We should work with upstream to migrate all packages. The migration will be > neccessary at some point even if numeric is fixed. > Packages using numeric are: [...] > dev-python/matplotlib The next public release of matplotlib (0.91) will not support numeric or numarray, only numpy. (In reply to comment #11) > We should work with upstream to migrate all packages. The migration will be > neccessary at some point even if numeric is fixed. > > Packages using numeric are: See bug #181653 comment #8 for comments on packages. Created attachment 129716 [details, diff]
python 2.5 fix for numeric-24.2
I just wrote a patch to fix it for python 2.5. Patch should be applied conditionally based on python version. Will contact upstream after the long weekend. Enjoy!
(In reply to comment #14) > Created an attachment (id=129716) [edit] > python 2.5 fix for numeric-24.2 > > I just wrote a patch to fix it for python 2.5. Patch should be applied > conditionally based on python version. Will contact upstream after the long > weekend. Enjoy! > Patch is busted with latest patchset. >>> Unpacking source... >>> Unpacking Numeric-24.2.tar.gz to /var/tmp/portage/dev-python/numeric-24.2-r6/work * Applying numeric-24.2-arrayobject.patch ... [ ok ] * Applying numeric-24.2-umath.patch ... [ ok ] * Applying numeric-24.2-eigen.patch ... [ ok ] * Applying numeric-24.2-test.patch ... [ ok ] * Applying numeric-24.2-python25.patch ... * Failed Patch: numeric-24.2-python25.patch ! * ( /usr/portage/dev-python/numeric/files/numeric-24.2-python25.patch ) I included a bunch of fixes including dsd in the lastest numeric in the tree. I don't see the problem initially reported on amd64 and all tests pass fine now. Although numeric is probably not fully 64bits safe, I am closing this bug. Re-open if you still see a problem. For those already having a numeric-24.2-r6 from the science overlay or a pre-03/09/2007 main tree, re-sync both the overlay and the tree before re-emerging numeric. dsd, if you contact upstream for the fix, could you send the other patches. |