New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stable/wheezy debian -- ar.argsort(kind='mergesort') causes TypeError: requested sort not available for type ( #505

Closed
yarikoptic opened this Issue Dec 15, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@yarikoptic
Member

yarikoptic commented Dec 15, 2014

numpy is 1.6.2 ;)


======================================================================
ERROR: dipy.tracking.tests.test_life.test_voxel2streamline
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildslave/nd-bb-slave-sparc64-wheezy/dipy-py2_7-wheezy-sparc/build/venv/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/buildslave/nd-bb-slave-sparc64-wheezy/dipy-py2_7-wheezy-sparc/build/venv/local/lib/python2.7/site-packages/dipy/tracking/tests/test_life.py", line 95, in test_voxel2streamline
    v2f, v2fn = life.voxel2streamline(streamline, False, affine)
  File "/home/buildslave/nd-bb-slave-sparc64-wheezy/dipy-py2_7-wheezy-sparc/build/venv/local/lib/python2.7/site-packages/dipy/tracking/life.py", line 305, in voxel2streamline
    unique_idx = unique_rows(all_coords.astype(int))
  File "/home/buildslave/nd-bb-slave-sparc64-wheezy/dipy-py2_7-wheezy-sparc/build/venv/local/lib/python2.7/site-packages/dipy/tracking/utils.py", line 638, in unique_rows
    u,i = np.unique(x, return_index=True)
  File "/usr/lib/pymodules/python2.7/numpy/lib/arraysetops.py", line 178, in unique
    perm = ar.argsort(kind='mergesort')
TypeError: requested sort not available for type

see full log
http://nipy.bic.berkeley.edu/builders/dipy-py2.7-wheezy-sparc/builds/67/steps/shell_6/logs/stdio

@arokem

This comment has been minimized.

Member

arokem commented Dec 15, 2014

Not sure I understand entirely. Do you think if I replaced the type I am
sorting on here from a float to an int that would work?

On Mon, Dec 15, 2014 at 6:58 AM, Yaroslav Halchenko <
notifications@github.com> wrote:

numpy is 1.6.2 ;)

ERROR: dipy.tracking.tests.test_life.test_voxel2streamline

Traceback (most recent call last):
File "/home/buildslave/nd-bb-slave-sparc64-wheezy/dipy-py2_7-wheezy-sparc/build/venv/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/buildslave/nd-bb-slave-sparc64-wheezy/dipy-py2_7-wheezy-sparc/build/venv/local/lib/python2.7/site-packages/dipy/tracking/tests/test_life.py", line 95, in test_voxel2streamline
v2f, v2fn = life.voxel2streamline(streamline, False, affine)
File "/home/buildslave/nd-bb-slave-sparc64-wheezy/dipy-py2_7-wheezy-sparc/build/venv/local/lib/python2.7/site-packages/dipy/tracking/life.py", line 305, in voxel2streamline
unique_idx = unique_rows(all_coords.astype(int))
File "/home/buildslave/nd-bb-slave-sparc64-wheezy/dipy-py2_7-wheezy-sparc/build/venv/local/lib/python2.7/site-packages/dipy/tracking/utils.py", line 638, in unique_rows
u,i = np.unique(x, return_index=True)
File "/usr/lib/pymodules/python2.7/numpy/lib/arraysetops.py", line 178, in unique
perm = ar.argsort(kind='mergesort')
TypeError: requested sort not available for type

see full log

http://nipy.bic.berkeley.edu/builders/dipy-py2.7-wheezy-sparc/builds/67/steps/shell_6/logs/stdio


Reply to this email directly or view it on GitHub
#505.

@yarikoptic

This comment has been minimized.

Member

yarikoptic commented Dec 15, 2014

On Mon, 15 Dec 2014, Ariel Rokem wrote:

Not sure I understand entirely. Do you think if I replaced the type I am
sorting on here from a float to an int that would work?

it seems not with mergesort (silly old numpy):

*(Pdb) print np.array(ar, dtype=[('f1', int), ('f2', int), ('f3', int)])
[(2, 3, 0) (5, 3, 0) (6, 3, 0) (7, 3, 0) (2, 3, 0) (5, 3, 0) (6, 3, 0)]

(Pdb) print np.array(ar, dtype=[('f1', int), ('f2', int), ('f3', int)]).argsort(kind='mergesort')
TypeError: requested sort not available for type

(Pdb) print np.array(ar, dtype=[('f1', int), ('f2', int), ('f3', int)]).argsort()
[0 4 1 5 2 6 3]

(Pdb) print ar.argsort()
[0 4 1 5 2 6 3]

Do you rely on the stability of mergesort? if not then may be you could
just switch to use quicksort on older numpys?

I think this feature was fixed up in
numpy/numpy@5be7e01

$> git describe --contains 5be7e01a6d67f2adeb167a280986547773dc3ce0
v1.7.0b127^26

so numpy >= 1.7.0

Yaroslav O. Halchenko, Ph.D.
http://neuro.debian.net http://www.pymvpa.org http://www.fail2ban.org
Research Scientist, Psychological and Brain Sciences Dept.
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834 Fax: +1 (603) 646-1419
WWW: http://www.linkedin.com/in/yarik

@arokem

This comment has been minimized.

Member

arokem commented Dec 15, 2014

I don't rely on mergesort (rather than any other sorting algorithm), but I
am not sure how to turn it off in this case: I am not calling argsort
myself at all. This error is triggered by a call that I am making to
np.unique, which downstream calls argsort with the 'mergesort' kwarg. I
am not sure I understand your last comment in the previous email. Do you
mean we should require numpy 1.7 as a minimal requirement for dipy?

On Mon, Dec 15, 2014 at 12:24 PM, Yaroslav Halchenko <
notifications@github.com> wrote:

On Mon, 15 Dec 2014, Ariel Rokem wrote:

Not sure I understand entirely. Do you think if I replaced the type I am
sorting on here from a float to an int that would work?

it seems not with mergesort (silly old numpy):

*(Pdb) print np.array(ar, dtype=[('f1', int), ('f2', int), ('f3', int)])
[(2, 3, 0) (5, 3, 0) (6, 3, 0) (7, 3, 0) (2, 3, 0) (5, 3, 0) (6, 3, 0)]

(Pdb) print np.array(ar, dtype=[('f1', int), ('f2', int), ('f3',
int)]).argsort(kind='mergesort')
TypeError: requested sort not available for type

(Pdb) print np.array(ar, dtype=[('f1', int), ('f2', int), ('f3',
int)]).argsort()
[0 4 1 5 2 6 3]

(Pdb) print ar.argsort()
[0 4 1 5 2 6 3]

Do you rely on the stability of mergesort? if not then may be you could
just switch to use quicksort on older numpys?

I think this feature was fixed up in

numpy/numpy@5be7e01

$> git describe --contains 5be7e01a6d67f2adeb167a280986547773dc3ce0
v1.7.0b127^26

so numpy >= 1.7.0

Yaroslav O. Halchenko, Ph.D.
http://neuro.debian.net http://www.pymvpa.org http://www.fail2ban.org
Research Scientist, Psychological and Brain Sciences Dept.
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834 Fax: +1 (603) 646-1419
WWW: http://www.linkedin.com/in/yarik


Reply to this email directly or view it on GitHub
#505 (comment).

@arokem

This comment has been minimized.

Member

arokem commented Dec 16, 2014

Closed through #507?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment