Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 176914
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Python Gentoo Team <python@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Darren Dale <dsdale24@gmail.com>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
numarray-1.3.1-py25.patch numarray fix patch Daniel Drake 2007-06-22 22:18 0000 1.46 KB Details | Diff
fix3.patch python 2.5 fix for numeric-24.2 patch Daniel Drake 2007-08-31 20:58 0000 638 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 176914 depends on: Show dependency tree
Bug 176914 blocks: 148333
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2007-05-03 13:07 0000
Numeric is not compatible with python-2.5 on 64bit arches. For example:

In [1]: import Numeric

In [2]: Numeric.arange(0,10)
Out[2]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

In [3]: Numeric.arange(0,10)[:10]
Out[3]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

In [4]: Numeric.arange(0,10)[:]
Out[4]: zeros((0,), 'l')

That last line should yield the same result as the previous command. Some
discussion can be found in this thread:
http://projects.scipy.org/pipermail/numpy-discussion/2007-May/027616.html

The problem has been reported upstream, but is unlikely to be addressed.
Numeric is not supported anymore, in favor of numpy.

Reproducible: Always

------- Comment #1 From Sébastien Fabbro 2007-05-03 14:51:37 0000 -------
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.

------- Comment #2 From Darren Dale 2007-05-03 17:29:50 0000 -------
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? 

------- Comment #3 From Sébastien Fabbro 2007-05-04 17:53:01 0000 -------
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?

------- Comment #4 From Darren Dale 2007-05-04 18:43:14 0000 -------
$ 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)

------- Comment #5 From delimy 2007-05-24 06:42:23 0000 -------
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.

------- Comment #6 From Sébastien Fabbro 2007-05-25 18:32:03 0000 -------
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

------- Comment #7 From Sébastien Fabbro 2007-06-07 14:11:56 0000 -------
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.

------- Comment #8 From Steven Hay 2007-06-16 14:40:42 0000 -------
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.

------- Comment #9 From Daniel Drake 2007-06-22 22:18:40 0000 -------
Created an attachment (id=122841) [details]
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.

------- Comment #10 From Daniel Drake 2007-06-22 22:19:15 0000 -------
forgot to mention, credit for that patch goes to Todd Miller.

------- Comment #11 From Santiago M. Mola 2007-07-16 15:15:48 0000 -------
(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

------- Comment #12 From Darren Dale 2007-07-16 15:39:04 0000 -------
(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.

------- Comment #13 From Sébastien Fabbro 2007-07-16 16:03:09 0000 -------
(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.

------- Comment #14 From Daniel Drake 2007-08-31 20:58:23 0000 -------
Created an attachment (id=129716) [details]
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!

------- Comment #15 From Jory A. Pratt 2007-09-02 04:29:59 0000 -------
(In reply to comment #14)
> Created an attachment (id=129716) [edit] [details]
> 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 )

------- Comment #16 From Sébastien Fabbro 2007-09-03 11:20:45 0000 -------
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.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug