summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_recfunctions.py
diff options
context:
space:
mode:
authorMark Wiebe <mwwiebe@gmail.com>2011-01-28 16:27:56 -0800
committerMark Wiebe <mwwiebe@gmail.com>2011-01-28 16:27:56 -0800
commit67e5476a4178de55451501cfb01794c22d340b7a (patch)
tree2a24b021001658deb92230692f8fad62e9355791 /numpy/lib/tests/test_recfunctions.py
parentcdac1209a517bf0808f12340d21ac9d334f69485 (diff)
parentaedce0eb9fa63e7dec3c865374a64e11374c284c (diff)
downloadnumpy-67e5476a4178de55451501cfb01794c22d340b7a.tar.gz
Merge branch 'new_iterator' - new iterator, ufunc update, restore 1.5 ABI
New Iterator - Read doc/neps/new-iterator-ufunc.rst. UFunc Update - Change all ufunc functions to use the new iterator. This replaces the inline buffering with iterator buffering, except for the reductions and generalized ufunc which use updateifcopy at the moment. Also adds out= and order= parameters to all ufuncs. Restore 1.5 ABI - This was done by moving the new type numbers to the end of the type enumeration, and replacing all type promotion code with a table-based approach. The ArrFuncs was restored by putting the new type cast functions into the cast dictionary, originally designed just for custom types. Conflicts: numpy/core/src/multiarray/ctors.c numpy/core/tests/test_regression.py
Diffstat (limited to 'numpy/lib/tests/test_recfunctions.py')
-rw-r--r--numpy/lib/tests/test_recfunctions.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/numpy/lib/tests/test_recfunctions.py b/numpy/lib/tests/test_recfunctions.py
index 0a22e2a34..14af43a59 100644
--- a/numpy/lib/tests/test_recfunctions.py
+++ b/numpy/lib/tests/test_recfunctions.py
@@ -540,13 +540,17 @@ class TestStackArrays(TestCase):
class TestJoinBy(TestCase):
+ def setUp(self):
+ self.a = np.array(zip(np.arange(10), np.arange(50, 60),
+ np.arange(100, 110)),
+ dtype=[('a', int), ('b', int), ('c', int)])
+ self.b = np.array(zip(np.arange(5, 15), np.arange(65, 75),
+ np.arange(100, 110)),
+ dtype=[('a', int), ('b', int), ('d', int)])
#
- def test_base(self):
+ def test_inner_join(self):
"Basic test of join_by"
- a = np.array(zip(np.arange(10), np.arange(50, 60), np.arange(100, 110)),
- dtype=[('a', int), ('b', int), ('c', int)])
- b = np.array(zip(np.arange(5, 15), np.arange(65, 75), np.arange(100, 110)),
- dtype=[('a', int), ('b', int), ('d', int)])
+ a, b = self.a, self.b
#
test = join_by('a', a, b, jointype='inner')
control = np.array([(5, 55, 65, 105, 100), (6, 56, 66, 106, 101),
@@ -555,6 +559,9 @@ class TestJoinBy(TestCase):
dtype=[('a', int), ('b1', int), ('b2', int),
('c', int), ('d', int)])
assert_equal(test, control)
+
+ def test_join(self):
+ a, b = self.a, self.b
#
test = join_by(('a', 'b'), a, b)
control = np.array([(5, 55, 105, 100), (6, 56, 106, 101),
@@ -562,6 +569,9 @@ class TestJoinBy(TestCase):
(9, 59, 109, 104)],
dtype=[('a', int), ('b', int),
('c', int), ('d', int)])
+
+ def test_outer_join(self):
+ a, b = self.a, self.b
#
test = join_by(('a', 'b'), a, b, 'outer')
control = ma.array([(0, 50, 100, -1), (1, 51, 101, -1),
@@ -587,6 +597,9 @@ class TestJoinBy(TestCase):
dtype=[('a', int), ('b', int),
('c', int), ('d', int)])
assert_equal(test, control)
+
+ def test_leftouter_join(self):
+ a, b = self.a, self.b
#
test = join_by(('a', 'b'), a, b, 'leftouter')
control = ma.array([(0, 50, 100, -1), (1, 51, 101, -1),