Author: mattip <[email protected]>
Branch: missing-ndarray-attributes
Changeset: r60165:e6abb66fd78f
Date: 2013-01-18 03:10 +0200
http://bitbucket.org/pypy/pypy/changeset/e6abb66fd78f/

Log:    add argsort test for sorting long runs

diff --git a/pypy/module/micronumpy/test/test_numarray.py 
b/pypy/module/micronumpy/test/test_numarray.py
--- a/pypy/module/micronumpy/test/test_numarray.py
+++ b/pypy/module/micronumpy/test/test_numarray.py
@@ -2344,6 +2344,10 @@
         from _numpypy import array
         a = array([[4, 2], [1, 3]])
         assert (a.argsort() == [[1, 0], [0, 1]]).all()
+        #trigger timsort run mode
+        a = array(range(100) + range(100) + range(100))
+        b = a.argsort()
+        assert (b[:3] == [0, 100, 200]).all()
 
     def test_argsort_axis(self):
         from _numpypy import array
diff --git a/pypy/rlib/listsort.py b/pypy/rlib/listsort.py
--- a/pypy/rlib/listsort.py
+++ b/pypy/rlib/listsort.py
@@ -517,6 +517,7 @@
         def merge_force_collapse(self):
             p = self.pending
             while len(p) > 1:
+                xxx
                 if len(p) >= 3 and p[-3].len < p[-1].len:
                     self.merge_at(-3)
                 else:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to