Skip to content
Browse files

STY remove trailing whitespace in a few files

  • Loading branch information...
1 parent 80140d2 commit 934d2ec31a34d69e8472cd3648ce26d01e620df0 @kwgoodman committed
Showing with 1,319 additions and 1,319 deletions.
  1. +5 −5 README.rst
  2. +891 −891 la/deflarry.py
  3. +305 −305 la/flarry.py
  4. +118 −118 la/tests/flarry_test.py
View
10 README.rst
@@ -18,14 +18,14 @@ array and a list of lists::
y.label = [['AAPL', 'IBM', 'DELL'], [date1, date2, date3]]
y.x = np.array([[209.19, 207.87, 210.11],
[129.03, 130.39, 130.55],
- [ 14.82, 15.11, 14.94]])
+ [ 14.82, 15.11, 14.94]])
A larry can have any number of dimensions except zero. Here, for example, is
one way to create a one-dimensional larry::
>>> import la
>>> y = la.larry([1, 2, 3])
-
+
In the statement above the list is converted to a Numpy array and the labels
default to ``range(n)``, where *n* in this case is 3.
@@ -44,7 +44,7 @@ dictionary-like interface::
>>> io['y'] = y # <--- save
>>> z = io['y'] # <--- load
>>> del io['y'] # <--- delete from archive
-
+
For the most part larry acts like a Numpy array. And, whenever you want,
you have direct access to the Numpy array that holds your data. For
example if you have a function, *myfunc*, that works on Numpy arrays and
@@ -90,7 +90,7 @@ To install ``la``::
$ python setup.py build
$ sudo python setup.py install
-
+
Or, if you wish to specify where ``la`` is installed, for example inside
``/usr/local``::
@@ -123,7 +123,7 @@ After you have installed ``la``, run the suite of unit tests::
Ran 2996 tests in 9.225s
OK
<nose.result.TextTestResult run=2996 errors=0 failures=0>
-
+
The ``la`` package contains C extensions that speed up common alignment
operations such as adding two unaligned larrys. If the C extensions don't
compile when you build ``la`` then there's an automatic fallback to python
View
1,782 la/deflarry.py
891 additions, 891 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
610 la/flarry.py
305 additions, 305 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
236 la/tests/flarry_test.py
@@ -15,10 +15,10 @@
class Test_func(unittest.TestCase):
- "Test larry functions in flarry"
-
+ "Test larry functions in flarry"
+
def test_union_1(self):
- "func.union_1"
+ "func.union_1"
y1 = larry([[1, 2], [3, 4]], [['a', 'b'], ['c', 'd']])
y2 = larry([[1, 2], [3, 4]], [['e', 'b'], ['f', 'd']])
actual = union(0, y1, y2)
@@ -26,10 +26,10 @@ def test_union_1(self):
self.assertTrue(actual == desired, 'union axis=0')
actual = union(1, y1, y2)
desired = ['c', 'd', 'f']
- self.assertTrue(actual == desired, 'union axis=1')
-
+ self.assertTrue(actual == desired, 'union axis=1')
+
def test_intersection_1(self):
- "func.intersection_1"
+ "func.intersection_1"
y1 = larry([[1, 2], [3, 4]], [['a', 'b'], ['c', 'd']])
y2 = larry([[1, 2], [3, 4]], [['e', 'b'], ['f', 'd']])
actual = intersection(0, y1, y2)
@@ -37,7 +37,7 @@ def test_intersection_1(self):
self.assertTrue(actual == desired, 'intersection axis=0')
actual = intersection(1, y1, y2)
desired = ['d']
- self.assertTrue(actual == desired, 'intersection axis=1')
+ self.assertTrue(actual == desired, 'intersection axis=1')
def test_isaligned_1(self):
"isaligned_1"
@@ -52,7 +52,7 @@ def test_isaligned_2(self):
lar2 = larry([[4, 5], [6, 7]], [['r2', 'r1'], ['c1', 'c2']])
a = isaligned(lar1, lar2, axis=0)
self.assertTrue(~a, "Should return False")
-
+
def test_isaligned_3(self):
"isaligned_3"
lar1 = larry([[1, 2], [3, 4]], [['r1', 'r2'], ['c1', 'c2']])
@@ -66,7 +66,7 @@ def test_isaligned_4(self):
lar2 = larry([5, 6], [['r1', 'r2']])
a = isaligned(lar1, lar2, axis=0)
self.assertTrue(a, "Should return True")
-
+
def test_isaligned_5(self):
"isaligned_5"
lar1 = larry([[1, 2], [3, 4]], [['r1', 'r2'], ['c1', 'c2']])
@@ -75,7 +75,7 @@ def test_isaligned_5(self):
self.assertTrue(~a, "Should return False")
def test_panel_1(self):
- "func.panel_1"
+ "func.panel_1"
x = np.ones((4,3), dtype=np.int).cumsum(0) - 1
label = [['r1', 'r2', 'r3', 'r4'], ['c1', 'c2', 'c3']]
original = larry(x, label)
@@ -94,11 +94,11 @@ def test_panel_1(self):
('r4', 'c1'),
('r4', 'c2'),
('r4', 'c3')], ['name']]
- desired = larry(x, label)
- ale(actual, desired, msg='panel test #1', original=original)
+ desired = larry(x, label)
+ ale(actual, desired, msg='panel test #1', original=original)
def test_panel_2(self):
- "func.panel_2"
+ "func.panel_2"
x = np.ones((4,3)).cumsum(0) - 1
label = [['r1', 'r2', 'r3', 'r4'], ['c1', 'c2', 'c3']]
original = larry(x, label)
@@ -121,43 +121,43 @@ def test_panel_2(self):
('r4', 'c1'),
('r4', 'c2'),
('r4', 'c3')], ['name', 'two']]
- desired = larry(x, label)
- ale(actual, desired, msg='panel test #2', original=original)
-
+ desired = larry(x, label)
+ ale(actual, desired, msg='panel test #2', original=original)
+
def test_stack_1(self):
- "func.stack_1"
+ "func.stack_1"
y1 = larry([[1, 2], [3, 4]])
y2 = larry([[5, 6], [7, 8]])
actual = stack('union', name1=y1, othername=y2)
x = np.array([[[ 1., 2.],
[ 3., 4.]],
[[ 5., 6.],
- [ 7., 8.]]])
+ [ 7., 8.]]])
label = [['name1', 'othername'], [0, 1], [0, 1]]
desired = larry(x, label)
- ale(actual, desired, msg='stack test #1')
-
+ ale(actual, desired, msg='stack test #1')
+
def test_cov_1(self):
- "func.cov_1"
+ "func.cov_1"
original = larry([[ 2.0, 2.0, 3.0, 1.0],
[ 3.0, 2.0, 2.0, 1.0],
[ 1.0, 1.0, 1.0, 1.0]])
- original = original.demean(axis=1)
+ original = original.demean(axis=1)
desired = larry([[ 0.5, 0.25, 0. ],
[ 0.25, 0.5, 0. ],
- [ 0., 0., 0. ]])
+ [ 0., 0., 0. ]])
actual = cov(original)
- ale(actual, desired, msg='cov test #1', original=original)
+ ale(actual, desired, msg='cov test #1', original=original)
def test_cov_2(self):
- "func.cov_2"
+ "func.cov_2"
original = larry([[nan, 2.0, 1.0],
[2.0, 3.0, 1.0],
- [4.0, 1.0, 1.0]])
- original = original.demean(1)
+ [4.0, 1.0, 1.0]])
+ original = original.demean(1)
desired = larry(np.ma.cov(np.ma.fix_invalid(original.x), bias=1).data)
actual = cov(original)
- ale(actual, desired, msg='cov test #2', original=original)
+ ale(actual, desired, msg='cov test #2', original=original)
def test_unique_1(self):
arr = unique(larry([1, 1, 2, 2, 3, 3]))
@@ -167,14 +167,14 @@ def test_unique_2(self):
lar = larry([[1, 1], [2, 3]])
arr = unique(lar)
assert_array_equal(arr, np.array([1, 2, 3]), "la.unique failed")
-
+
def test_unique_3(self):
lar = larry(['a', 'b', 'b', 'c', 'a'])
u, indices = unique(lar, return_index=True)
assert_array_equal(u, np.array(['a', 'b', 'c']))
assert_array_equal(indices, np.array([0, 1, 3]))
assert_array_equal(lar[indices], np.array(['a','b','c']))
-
+
def test_unique_4(self):
lar = larry([1, 2, 6, 4, 2, 3, 2])
u, indices = unique(lar, return_inverse=True)
@@ -183,7 +183,7 @@ def test_unique_4(self):
assert_array_equal(u[indices], np.array([1, 2, 6, 4, 2, 3, 2]))
class Test_align_1d(unittest.TestCase):
- "Test 1d alignment of larrys"
+ "Test 1d alignment of larrys"
def test_1d1(self):
"align 1d test #1"
@@ -194,7 +194,7 @@ def test_1d1(self):
d2 = larry([1, 2])
msg = "align 1d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
- ale(a2, d2, msg % 'right', original=y2)
+ ale(a2, d2, msg % 'right', original=y2)
def test_1d2(self):
"align 1d test #2"
@@ -205,7 +205,7 @@ def test_1d2(self):
d2 = larry([1, 2])
msg = "align 1d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
- ale(a2, d2, msg % 'right', original=y2)
+ ale(a2, d2, msg % 'right', original=y2)
def test_1d3(self):
"align 1d test #3"
@@ -216,7 +216,7 @@ def test_1d3(self):
d2 = larry([1, 2])
msg = "align 1d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
- ale(a2, d2, msg % 'right', original=y2)
+ ale(a2, d2, msg % 'right', original=y2)
def test_1d4(self):
"align 1d test #4"
@@ -228,12 +228,12 @@ def test_1d4(self):
msg = "align 1d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
ale(a2, d2, msg % 'right', original=y2)
-
+
def test_1d5(self):
"align 1d test #5"
y1 = larry([1, 2])
y2 = larry([1, 2, 3])
- self.assertRaises(TypeError, align, y1, y2, 'outer', False)
+ self.assertRaises(TypeError, align, y1, y2, 'outer', False)
def test_1d6(self):
"align 1d test #6"
@@ -256,7 +256,7 @@ def test_1d7(self):
msg = "align 1d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
ale(a2, d2, msg % 'right', original=y2)
-
+
def test_1d8(self):
"align 1d test #8"
y1 = larry([1, 2])
@@ -266,7 +266,7 @@ def test_1d8(self):
d2 = larry([1, 2, 3])
msg = "align 1d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
- ale(a2, d2, msg % 'right', original=y2)
+ ale(a2, d2, msg % 'right', original=y2)
def test_1d9(self):
"align 1d test #9"
@@ -277,7 +277,7 @@ def test_1d9(self):
d2 = larry([], dtype=int)
msg = "align 1d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
- ale(a2, d2, msg % 'right', original=y2)
+ ale(a2, d2, msg % 'right', original=y2)
def test_1d10(self):
"align 1d test #10"
@@ -288,7 +288,7 @@ def test_1d10(self):
d2 = larry([], dtype=int)
msg = "align 1d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
- ale(a2, d2, msg % 'right', original=y2)
+ ale(a2, d2, msg % 'right', original=y2)
def test_1d11(self):
"align 1d test #11"
@@ -299,7 +299,7 @@ def test_1d11(self):
d2 = larry([], dtype=int)
msg = "align 1d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
- ale(a2, d2, msg % 'right', original=y2)
+ ale(a2, d2, msg % 'right', original=y2)
def test_1d12(self):
"align 1d test #12"
@@ -311,7 +311,7 @@ def test_1d12(self):
msg = "align 1d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
ale(a2, d2, msg % 'right', original=y2)
-
+
def test_1d13(self):
"align 1d test #13"
y1 = larry([1, 2])
@@ -327,7 +327,7 @@ def test_1d14(self):
d2 = larry([nan, nan])
msg = "align 1d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
- ale(a2, d2, msg % 'right', original=y2)
+ ale(a2, d2, msg % 'right', original=y2)
def test_1d15(self):
"align 1d test #15"
@@ -339,7 +339,7 @@ def test_1d15(self):
msg = "align 1d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
ale(a2, d2, msg % 'right', original=y2)
-
+
def test_1d16(self):
"align 1d test #16"
y1 = larry([1, 2])
@@ -350,12 +350,12 @@ def test_1d16(self):
msg = "align 1d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
ale(a2, d2, msg % 'right', original=y2)
-
+
def test_1d17(self):
"align 1d test #17"
y1 = larry([1, 2])
- y2 = larry([1, 2], [['a', 'b']])
- self.assertRaises(TypeError, align, y1, y2, 'outer', False)
+ y2 = larry([1, 2], [['a', 'b']])
+ self.assertRaises(TypeError, align, y1, y2, 'outer', False)
def test_1d18(self):
"align 1d test #18"
@@ -367,7 +367,7 @@ def test_1d18(self):
msg = "align 1d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
ale(a2, d2, msg % 'right', original=y2)
-
+
def test_1d19(self):
"align 1d test #19"
y1 = larry([True, False])
@@ -377,7 +377,7 @@ def test_1d19(self):
d2 = larry([True, False, True])
msg = "align 1d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
- ale(a2, d2, msg % 'right', original=y2)
+ ale(a2, d2, msg % 'right', original=y2)
def test_1d20(self):
"align 1d test #20"
@@ -402,7 +402,7 @@ def test_1d21(self):
ale(a2, d2, msg % 'right', original=y2)
class Test_align_2d(unittest.TestCase):
- "Test 2d alignment of larrys"
+ "Test 2d alignment of larrys"
def test_2d1(self):
"align 2d test #1"
@@ -413,7 +413,7 @@ def test_2d1(self):
d2 = larry([[1, 2], [3, 4]])
msg = "align 2d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
- ale(a2, d2, msg % 'right', original=y2)
+ ale(a2, d2, msg % 'right', original=y2)
def test_2d2(self):
"align 2d test #2"
@@ -424,7 +424,7 @@ def test_2d2(self):
d2 = larry([[1, 2], [3, 4]])
msg = "align 2d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
- ale(a2, d2, msg % 'right', original=y2)
+ ale(a2, d2, msg % 'right', original=y2)
def test_2d3(self):
"align 2d test #3"
@@ -452,7 +452,7 @@ def test_2d5(self):
"align 2d test #5"
y1 = larry([[1, 2], [3, 4]])
y2 = larry([[1, 2, 5], [3, 4, 6]])
- self.assertRaises(TypeError, align, y1, y2, 'outer', False)
+ self.assertRaises(TypeError, align, y1, y2, 'outer', False)
def test_2d6(self):
"align 2d test #6"
@@ -482,7 +482,7 @@ def test_2d8(self):
msg = "align 2d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
ale(a2, d2, msg % 'right', original=y2)
-
+
def test_2d9(self):
"align 2d test #9"
y1 = larry([[1, 2], [3, 4]])
@@ -491,7 +491,7 @@ def test_2d9(self):
d1, d2 = y1.copy(), y2.copy()
msg = "align 2d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
- ale(a2, d2, msg % 'right', original=y2)
+ ale(a2, d2, msg % 'right', original=y2)
def test_2d10(self):
"align 2d test #10"
@@ -502,7 +502,7 @@ def test_2d10(self):
d2 = larry([[1, 2, 5], [3, 4, 6]])
msg = "align 2d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
- ale(a2, d2, msg % 'right', original=y2)
+ ale(a2, d2, msg % 'right', original=y2)
def test_2d11(self):
"align 2d test #11"
@@ -514,7 +514,7 @@ def test_2d11(self):
d2 = larry([[0.1, 0.2, 0.5], [0.3, 0.4, 0.6]])
msg = "align 2d fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
- ale(a2, d2, msg % 'right', original=y2)
+ ale(a2, d2, msg % 'right', original=y2)
class Test_align_axis(unittest.TestCase):
"Test align_axis on larrys"
@@ -528,8 +528,8 @@ def test_align_axis_1(self):
d2 = larry([[0.1, 0.2, 0.5], [0.3, 0.4, 0.6]])
msg = "align_axis fail on %s larry"
ale(a1, d1, msg % 'left', original=y1)
- ale(a2, d2, msg % 'right', original=y2)
-
+ ale(a2, d2, msg % 'right', original=y2)
+
def test_align_axis_2(self):
"align 2d test #10"
y1 = larry([[1, 2], [3, 4], [7, 8]])
@@ -583,7 +583,7 @@ def test_align_axis_5(self):
ale(a1, d1, msg % '1st', original=y1)
ale(a2, d2, msg % '2nd', original=y2)
ale(a3, d3, msg % '3rd', original=y3)
-
+
def test_align_axis_6(self):
y1 = larry([[1.0, 2.0],
[3.0, 4.0],
@@ -595,9 +595,9 @@ def test_align_axis_6(self):
[nan, nan],
[3.0, 4.0],
[5.0, 6.0],
- [nan, nan]],
+ [nan, nan]],
label = [['a', 'aa', 'b', 'c', 'cc'], [1, 2]])
- d2 = larry([['x'], [''], ['y'], [''], ['z']],
+ d2 = larry([['x'], [''], ['y'], [''], ['z']],
[['a', 'aa', 'b', 'c', 'cc'], [1]])
d3 = larry([nan, 50.0, 51.0, 52.0, nan], [['a', 'aa', 'b', 'c', 'cc']])
msg = "align_axis fail on %s larry"
@@ -615,7 +615,7 @@ def test_align_axis_7(self):
d1 = larry([[1.0, 2.0],
[3.0, 4.0],
[5.0, 6.0]], [['a', 'b', 'c'], [1, 2]])
- d2 = larry([['x'], ['y'], ['']],
+ d2 = larry([['x'], ['y'], ['']],
[['a', 'b', 'c'], [1]])
d3 = larry([nan, 51.0, 52.0], [['a', 'b', 'c']])
msg = "align_axis fail on %s larry"
@@ -633,7 +633,7 @@ def test_align_axis_8(self):
d1 = larry([[1.0, 2.0],
[3.0, 4.0],
[5.0, 6.0]], [['a', 'b', 'c'], [1, 2]])
- d2 = larry([['x'], ['y'], ['']],
+ d2 = larry([['x'], ['y'], ['']],
[['a', 'b', 'c'], [1]])
d3 = larry([nan, 51.0, 52.0], [['a', 'b', 'c']])
msg = "align_axis fail on %s larry"
@@ -653,7 +653,7 @@ def test_align_axis_9(self):
[3.0, 4.0],
[5.0, 6.0]], [['a', 'b', 'c'], [1, 2]])
d1 = d1.T
- d2 = larry([['x'], ['y'], ['']],
+ d2 = larry([['x'], ['y'], ['']],
[['a', 'b', 'c'], [1]])
d3 = larry([nan, 51.0, 52.0], [['a', 'b', 'c']])
msg = "align_axis fail on %s larry"
@@ -731,7 +731,7 @@ def test_zeros_4(self):
ale(a, d, "zeros failed.")
class Test_binaryop(unittest.TestCase):
- "Test la.binaryop()"
+ "Test la.binaryop()"
def test_binaryop_01(self):
"binaryop test #01"
@@ -741,7 +741,7 @@ def test_binaryop_01(self):
desired = larry([2, 4])
msg = "binaryop failed"
ale(actual, desired, msg, original=y1)
- ale(actual, desired, msg, original=y2)
+ ale(actual, desired, msg, original=y2)
def test_binaryop_02(self):
"binaryop test #02"
@@ -752,7 +752,7 @@ def test_binaryop_02(self):
msg = "binaryop failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_binaryop_03(self):
"binaryop test #03"
y1 = larry([1, 2])
@@ -762,7 +762,7 @@ def test_binaryop_03(self):
msg = "binaryop failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_binaryop_04(self):
"binaryop test #04"
y1 = larry([1, 2])
@@ -792,7 +792,7 @@ def test_binaryop_06(self):
msg = "binaryop failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_binaryop_07(self):
"binaryop test #07"
y1 = larry([1, 2])
@@ -802,7 +802,7 @@ def test_binaryop_07(self):
msg = "binaryop failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_binaryop_08(self):
"binaryop test #08"
y1 = larry([1, 2])
@@ -822,7 +822,7 @@ def test_binaryop_09(self):
msg = "binaryop failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_binaryop_10(self):
"binaryop test #10"
y1 = larry([1, 2])
@@ -832,7 +832,7 @@ def test_binaryop_10(self):
msg = "binaryop failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_binaryop_11(self):
"binaryop test #11"
y1 = larry([1, 2])
@@ -842,7 +842,7 @@ def test_binaryop_11(self):
msg = "binaryop failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_binaryop_12(self):
"binaryop test #12"
y1 = larry([1, 2])
@@ -851,7 +851,7 @@ def test_binaryop_12(self):
desired = larry([2, 4])
msg = "binaryop failed"
ale(actual, desired, msg, original=y1)
- ale(actual, desired, msg, original=y2)
+ ale(actual, desired, msg, original=y2)
def test_binaryop_13(self):
"binaryop test #13"
@@ -862,7 +862,7 @@ def test_binaryop_13(self):
msg = "binaryop failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_binaryop_14(self):
"binaryop test #14"
y1 = larry([1, 2])
@@ -872,7 +872,7 @@ def test_binaryop_14(self):
msg = "binaryop failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_binaryop_15(self):
"binaryop test #15"
y1 = larry([1, 2])
@@ -892,7 +892,7 @@ def test_binaryop_16(self):
msg = "binaryop failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_binaryop_17(self):
"binaryop test #17"
y1 = larry([1, nan, nan, 1])
@@ -922,7 +922,7 @@ def test_binaryop_19(self):
msg = "binaryop failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_binaryop_20(self):
"binaryop test #20"
y1 = larry([1, nan, nan, 1])
@@ -941,7 +941,7 @@ def test_binaryop_21(self):
desired = larry([True, False])
msg = "binaryop failed"
ale(actual, desired, msg, original=y1)
- ale(actual, desired, msg, original=y2)
+ ale(actual, desired, msg, original=y2)
def test_binaryop_22(self):
"binaryop test #22"
@@ -955,10 +955,10 @@ def test_binaryop_22(self):
desired = larry([True, False, True])
msg = "binaryop failed"
ale(actual, desired, msg, original=y1)
- ale(actual, desired, msg, original=y2)
+ ale(actual, desired, msg, original=y2)
class Test_add(unittest.TestCase):
- "Test la.add()"
+ "Test la.add()"
def test_add_01(self):
"add test #01"
@@ -968,7 +968,7 @@ def test_add_01(self):
desired = larry([2, 4])
msg = "add failed"
ale(actual, desired, msg, original=y1)
- ale(actual, desired, msg, original=y2)
+ ale(actual, desired, msg, original=y2)
def test_add_02(self):
"add test #02"
@@ -979,7 +979,7 @@ def test_add_02(self):
msg = "add failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_add_03(self):
"add test #03"
y1 = larry([1, 2])
@@ -989,7 +989,7 @@ def test_add_03(self):
msg = "add failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_add_04(self):
"add test #04"
y1 = larry([1, 2])
@@ -1019,7 +1019,7 @@ def test_add_06(self):
msg = "add failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_add_07(self):
"add test #07"
y1 = larry([1, 2])
@@ -1029,7 +1029,7 @@ def test_add_07(self):
msg = "add failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_add_08(self):
"add test #08"
y1 = larry([1, 2])
@@ -1049,7 +1049,7 @@ def test_add_09(self):
msg = "add failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_add_10(self):
"add test #10"
y1 = larry([1, 2])
@@ -1059,7 +1059,7 @@ def test_add_10(self):
msg = "add failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_add_11(self):
"add test #11"
y1 = larry([1, 2])
@@ -1069,7 +1069,7 @@ def test_add_11(self):
msg = "add failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_add_12(self):
"add test #12"
y1 = larry([1, 2])
@@ -1078,7 +1078,7 @@ def test_add_12(self):
desired = larry([2, 4])
msg = "add failed"
ale(actual, desired, msg, original=y1)
- ale(actual, desired, msg, original=y2)
+ ale(actual, desired, msg, original=y2)
def test_add_13(self):
"add test #13"
@@ -1089,7 +1089,7 @@ def test_add_13(self):
msg = "add failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_add_14(self):
"add test #14"
y1 = larry([1, 2])
@@ -1099,7 +1099,7 @@ def test_add_14(self):
msg = "add failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_add_15(self):
"add test #15"
y1 = larry([1, 2])
@@ -1119,7 +1119,7 @@ def test_add_16(self):
msg = "add failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_add_17(self):
"add test #17"
y1 = larry([1, nan, nan, 1])
@@ -1149,7 +1149,7 @@ def test_add_19(self):
msg = "add failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
def test_add_20(self):
"add test #20"
y1 = larry([1, nan, nan, 1])
@@ -1161,7 +1161,7 @@ def test_add_20(self):
ale(actual, desired, msg, original=y2)
class Test_subtract(unittest.TestCase):
- "Test la.subtract()"
+ "Test la.subtract()"
def test_subtract_01(self):
"subtract test #01"
@@ -1181,8 +1181,8 @@ def test_subtract_02(self):
desired = larry([0, 2], [['a', 'b']], dtype=float)
msg = "subtract failed"
ale(actual, desired, msg, original=y1)
- ale(actual, desired, msg, original=y2)
-
+ ale(actual, desired, msg, original=y2)
+
def test_subtract_03(self):
"subtract test #03"
y1 = larry([1, 2, nan], [['a', 'b', 'c']])
@@ -1191,7 +1191,7 @@ def test_subtract_03(self):
desired = larry([0, nan, nan, nan], [['a', 'b', 'c', 'dd']])
msg = "subtract failed"
ale(actual, desired, msg, original=y1)
- ale(actual, desired, msg, original=y2)
+ ale(actual, desired, msg, original=y2)
def test_subtract_04(self):
"subtract test #04"
@@ -1201,10 +1201,10 @@ def test_subtract_04(self):
desired = larry([0, 2, 0, 0], [['a', 'b', 'c', 'dd']], dtype=float)
msg = "subtract failed"
ale(actual, desired, msg, original=y1)
- ale(actual, desired, msg, original=y2)
+ ale(actual, desired, msg, original=y2)
class Test_multiply(unittest.TestCase):
- "Test la.multiply()"
+ "Test la.multiply()"
def test_multiply_01(self):
"multiply test #01"
@@ -1215,9 +1215,9 @@ def test_multiply_01(self):
msg = "multiply failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
class Test_divide(unittest.TestCase):
- "Test la.divide()"
+ "Test la.divide()"
def test_divide_01(self):
"divide test #01"
@@ -1228,23 +1228,23 @@ def test_divide_01(self):
msg = "divide failed"
ale(actual, desired, msg, original=y1)
ale(actual, desired, msg, original=y2)
-
+
class Test_sortby(unittest.TestCase):
"Test la.sortby()"
-
+
def setUp(self):
label = [['a','b'], ['c','d','e']]
x = np.array([[1, 2, 3],
[3, 1, 2]])
self.lar = larry(x,label)
-
+
def test_sortby_1(self):
"sortby test #1"
theory = self.lar[:,[1, 2, 0]]
practice = sortby(self.lar, 'b', 0)
msg = "Sorting by element in axis 0 failed"
ale(theory, practice, msg=msg)
-
+
def test_sortby_2(self):
"sortby test #2"
theory = self.lar[[1, 0],:]
@@ -1258,7 +1258,7 @@ def test_sortby_3(self):
practice = sortby(self.lar, 'b', -2)
msg = "Sorting by element in axis -2 failed"
ale(theory, practice, msg=msg)
-
+
def test_sortby_4(self):
"sortby test #4"
theory = self.lar[[1, 0],:]
@@ -1272,7 +1272,7 @@ def test_sortby_5(self):
practice = sortby(self.lar, 'b', 0, reverse=True)
msg = "Reverse sorting by element in axis 0 failed"
ale(theory, practice, msg=msg)
-
+
def test_sortby_6(self):
"sortby test #6"
theory = self.lar
@@ -1286,25 +1286,25 @@ def test_sortby_7(self):
practice = sortby(theory, 0, 0)
msg = "Sorting empty larry failed"
ale(theory, practice, msg=msg)
-
- def test_sortby_8(self):
+
+ def test_sortby_8(self):
"sortby test #8"
- self.assertRaises(ValueError, sortby, self.lar, 'b', 2)
-
+ self.assertRaises(ValueError, sortby, self.lar, 'b', 2)
+
def test_sortby_9(self):
"sortby test #9"
self.assertRaises(ValueError, sortby, self.lar, 'b', -3)
-
+
def test_sortby_10(self):
"sortby test #10"
lar = self.lar[0]
- self.assertRaises(ValueError, sortby, lar, 'd', 0)
-
+ self.assertRaises(ValueError, sortby, lar, 'd', 0)
+
def test_sortby_11(self):
"sortby test #11"
lar = rand(0,2)
self.assertRaises(IndexError, sortby, lar, 0, 0)
-
+
def test_sortby_12(self):
"sortby test #12"
lar = rand(0,2)
@@ -1312,4 +1312,4 @@ def test_sortby_12(self):
practice = sortby(lar, 0, 1)
msg="Sorting empty larry failed"
ale(theory, practice, msg=msg)
-
+

0 comments on commit 934d2ec

Please sign in to comment.
Something went wrong with that request. Please try again.