Example #1
0
 def test_binaryop_20(self):
     "binaryop test #20"
     y1 = larry([1, nan, nan, 1])
     y2 = larry([1, 1, nan, 1], [[0, 1, 2, 'a']])
     actual = binaryop(np.add, y1, y2, join='outer', missone=0, misstwo=0)
     desired = larry([2, 1, 0, 1, 1], [[0, 1, 2, 3, 'a']], dtype=float)
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)
Example #2
0
 def test_binaryop_16(self):
     "binaryop test #16"
     y1 = larry([1, 2])
     y2 = larry([1, 2, 3])
     actual = binaryop(np.add, y1, y2, join='right', misstwo=0)
     desired = larry([2, 4, nan])
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)
Example #3
0
 def test_binaryop_18(self):
     "binaryop test #18"
     y1 = larry([1, nan, nan, 1])
     y2 = larry([1, 1, nan, 1], [[0, 1, 2, 'a']])
     actual = binaryop(np.add, y1, y2, join='outer')
     desired = larry([2, nan, nan, nan, nan], [[0, 1, 2, 3, 'a']])
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)
Example #4
0
 def test_binaryop_15(self):
     "binaryop test #15"
     y1 = larry([1, 2])
     y2 = larry([1, 2, 3])
     actual = binaryop(np.add, y1, y2, join='right', missone=0, misstwo=0)
     desired = larry([2, 4, 3], dtype=float)
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)
Example #5
0
 def test_binaryop_12(self):
     "binaryop test #12"
     y1 = larry([1, 2])
     y2 = larry([1, 2, 3])
     actual = binaryop(np.add, y1, y2, join='left', missone=0, misstwo=0)
     desired = larry([2, 4])
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)
Example #6
0
 def test_binaryop_06(self):
     "binaryop test #06"
     y1 = larry([1, 2])
     y2 = larry([1, 2, 3])
     actual = binaryop(np.add, y1, y2, join='outer')
     desired = larry([2, 4, nan])
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)
Example #7
0
 def test_binaryop_21(self):
     "binaryop test #21"
     y1 = larry([True, True])
     y2 = larry([True, False, True])
     actual = binaryop(np.logical_and, y1, y2)
     desired = larry([True, False])
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)
Example #8
0
 def test_binaryop_19(self):
     "binaryop test #19"
     y1 = larry([1, nan, nan, 1])
     y2 = larry([1, 1,   nan, 1], [[0, 1, 2, 'a']])
     actual = binaryop(np.add, y1, y2, join='outer', missone=0)
     desired = larry([2, 1, nan, 1, 1], [[0, 1, 2, 3, 'a']])
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)
Example #9
0
 def test_binaryop_19(self):
     "binaryop test #19"
     y1 = larry([1, nan, nan, 1])
     y2 = larry([1, 1, nan, 1], [[0, 1, 2, 9]])
     actual = binaryop(np.add, y1, y2, join='outer', missone=0)
     desired = larry([2, 1, nan, 1, 1], [[0, 1, 2, 3, 9]])
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)
Example #10
0
 def test_binaryop_20(self):
     "binaryop test #20"
     y1 = larry([1, nan, nan, 1])
     y2 = larry([1, 1,   nan, 1], [[0, 1, 2, 9]])
     actual = binaryop(np.add, y1, y2, join='outer', missone=0, misstwo=0)
     desired = larry([2, 1, 0, 1, 1], [[0, 1, 2, 3, 9]], dtype=float)
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)
Example #11
0
 def test_binaryop_21(self):
     "binaryop test #21"
     y1 = larry([True, True])
     y2 = larry([True, False, True])
     actual = binaryop(np.logical_and, y1, y2)
     desired = larry([True, False])
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2) 
Example #12
0
 def test_binaryop_17(self):
     "binaryop test #17"
     y1 = larry([1, nan, nan, 1])
     y2 = larry([1, 1,   nan, 1], [[0, 1, 2, 'a']])
     actual = binaryop(np.add, y1, y2)
     desired = larry([2, nan, nan], [[0, 1, 2]])
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)
Example #13
0
 def test_binaryop_18(self):
     "binaryop test #18"
     y1 = larry([1, nan, nan, 1])
     y2 = larry([1, 1,   nan, 1], [[0, 1, 2, 9]])
     actual = binaryop(np.add, y1, y2, join='outer')
     desired = larry([2, nan, nan, nan, nan], [[0, 1, 2, 3, 9]])
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)
Example #14
0
 def test_binaryop_15(self):
     "binaryop test #15"
     y1 = larry([1, 2])
     y2 = larry([1, 2, 3])
     actual = binaryop(np.add, y1, y2, join='right', missone=0, misstwo=0)
     desired = larry([2, 4, 3], dtype=float)
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)
Example #15
0
 def test_binaryop_16(self):
     "binaryop test #16"
     y1 = larry([1, 2])
     y2 = larry([1, 2, 3])
     actual = binaryop(np.add, y1, y2, join='right', misstwo=0)
     desired = larry([2, 4, nan])
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)
Example #16
0
 def test_binaryop_12(self):
     "binaryop test #12"
     y1 = larry([1, 2])
     y2 = larry([1, 2, 3])
     actual = binaryop(np.add, y1, y2, join='left', missone=0, misstwo=0)
     desired = larry([2, 4])
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)       
Example #17
0
 def test_binaryop_06(self):
     "binaryop test #06"
     y1 = larry([1, 2])
     y2 = larry([1, 2, 3])
     actual = binaryop(np.add, y1, y2, join='outer')
     desired = larry([2, 4, nan])
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)
Example #18
0
 def test_binaryop_05(self):
     "binaryop test #05"
     y1 = larry([1, 2])
     y2 = larry([1, 2, 3])
     actual = binaryop(np.add, y1, y2, misstwo=0)
     desired = larry([2, 4])
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)
Example #19
0
 def test_binaryop_05(self):
     "binaryop test #05"
     y1 = larry([1, 2])
     y2 = larry([1, 2, 3])
     actual = binaryop(np.add, y1, y2, misstwo=0)
     desired = larry([2, 4])
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)
Example #20
0
 def test_binaryop_22(self):
     "binaryop test #22"
     # This is a corner case. The binaryop function uses the align_raw
     # function which converts the bool larrys to float since it must
     # fill in a missing value. And then logical_and(nan, True) returns
     # True.
     y1 = larry([True, True])
     y2 = larry([True, False, True])
     actual = binaryop(np.logical_and, y1, y2, join='outer')
     desired = larry([True, False, True])
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2) 
Example #21
0
 def test_binaryop_22(self):
     "binaryop test #22"
     # This is a corner case. The binaryop function uses the align_raw
     # function which converts the bool larrys to float since it must
     # fill in a missing value. And then logical_and(nan, True) returns
     # True.
     y1 = larry([True, True])
     y2 = larry([True, False, True])
     actual = binaryop(np.logical_and, y1, y2, join='outer')
     desired = larry([True, False, True])
     msg = "binaryop failed"
     ale(actual, desired, msg, original=y1)
     ale(actual, desired, msg, original=y2)