示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#10
0
文件: flarry_test.py 项目: alpmdog/la
 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)
示例#11
0
文件: flarry_test.py 项目: alpmdog/la
 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) 
示例#12
0
文件: flarry_test.py 项目: alpmdog/la
 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)
示例#13
0
文件: flarry_test.py 项目: alpmdog/la
 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)
示例#14
0
文件: flarry_test.py 项目: alpmdog/la
 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)
示例#15
0
文件: flarry_test.py 项目: alpmdog/la
 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)
示例#16
0
文件: flarry_test.py 项目: alpmdog/la
 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)       
示例#17
0
文件: flarry_test.py 项目: alpmdog/la
 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)
示例#18
0
文件: flarry_test.py 项目: alpmdog/la
 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)
示例#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)
示例#20
0
文件: flarry_test.py 项目: alpmdog/la
 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) 
示例#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)