diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2018-02-14 17:09:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-14 17:09:12 -0700 |
commit | a2780f090502291013802a7d61cbe7cc4f0f84de (patch) | |
tree | d013bf501964d4e62f1a234c71517435f6a9a66e /numpy/lib/tests/test_arraysetops.py | |
parent | 8f6c30b9bed7ae529de58cf92db943d8553da843 (diff) | |
parent | f28615092d6cd7f849dd09d0dc57471af7def143 (diff) | |
download | numpy-a2780f090502291013802a7d61cbe7cc4f0f84de.tar.gz |
Merge pull request #10588 from charris/remove-unique-optimization
BUG: Revert sort optimization in np.unique.
Diffstat (limited to 'numpy/lib/tests/test_arraysetops.py')
-rw-r--r-- | numpy/lib/tests/test_arraysetops.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py index 17415d8fe..8286834a4 100644 --- a/numpy/lib/tests/test_arraysetops.py +++ b/numpy/lib/tests/test_arraysetops.py @@ -4,6 +4,8 @@ from __future__ import division, absolute_import, print_function import numpy as np +import sys + from numpy.testing import ( run_module_suite, assert_array_equal, assert_equal, assert_raises, ) @@ -453,6 +455,15 @@ class TestUnique(object): assert_array_equal(v.data, v2.data, msg) assert_array_equal(v.mask, v2.mask, msg) + def test_unique_sort_order_with_axis(self): + # These tests fail if sorting along axis is done by treating subarrays + # as unsigned byte strings. See gh-10495. + fmt = "sort order incorrect for integer type '%s'" + for dt in 'bhilq': + a = np.array([[-1],[0]], dt) + b = np.unique(a, axis=0) + assert_array_equal(a, b, fmt % dt) + def _run_axis_tests(self, dtype): data = np.array([[0, 1, 0, 0], [1, 0, 0, 0], |