def lix_setitem_test_09(): def lixit(lar, index, value): lar.lix[index] = value actual = la.lrange(label=[['a', 'b'], ['c', 'd']]) index = ['a'] value = la.larry([10, 9], [['d', 'c']]) assert_raises(IndexError, lixit, actual, index, value)
def test_io_lara_1(self): "lara indexing bug #40" io = IO(self.filename) io['a'] = la.lrange(3) b = io['a'] # b[[0, 2]] raised: # AttributeError: 'Dataset' object has no attribute 'take' b[[0, 2]]
def test_io_lara_1(self): "lara indexing bug #40" io = IO(self.filename) io['a'] = la.lrange(3) b = io['a'] # b[[0, 2]] raised: # AttributeError: 'Dataset' object has no attribute 'take' b[[0,2]]
def test_lrange_2(self): a = lrange(label=[['a', 'b', 'c', 'd']]) d = larry([0, 1, 2, 3], [['a', 'b', 'c', 'd']]) ale(a, d, "lrange failed.")
def larry_init_array_test(): "larry.__init__array" desired = larry(np.array([[0, 1], [2, 3]])) actual = la.lrange((2, 2)) ale(actual, desired, msg='create larry from matrix')
def test_lrange_4(self): a = lrange(label=[['a', 'b'], ['c', 'd']]) d = larry([[0, 1], [2, 3]], [['a', 'b'], ['c', 'd']]) ale(a, d, "lrange failed.")
def lix_setitem_test_07(): actual = la.lrange(label=[['a', 'b', 'c'], ['1', '2', '3']]) actual.lix[['a', 'b'], ['1', '2']] = np.arange(4).reshape(2, 2) desired = la.lrange(label=[['a', 'b', 'c'], ['1', '2', '3']]) desired[:2, :2] = np.arange(4).reshape(2, 2) ale(actual, desired)
def lix_setitem_test_01(): actual = la.lrange(label=[['a', 'b']]) actual.lix[['a']] = 9 desired = la.lrange(label=[['a', 'b']]) desired[0] = 9 ale(actual, desired)
def larry_init_list_test(): "larry.__init__list" desired = larry([[0, 1], [2, 3]]) actual = la.lrange((2, 2)) ale(actual, desired, msg='create larry from list')
def larry_init_tuple_test(): "larry.__init__tuple" desired = larry(((0, 1), (2, 3))) actual = la.lrange((2, 2)) ale(actual, desired, msg='create larry from tuple')
def test_lrange_3(self): a = lrange((2, 2), dtype='f8') d = larry(np.array([0, 1, 2, 3], dtype='f8').reshape(2, 2)) ale(a, d, "lrange failed.")
def lix_setitem_test_05(): actual = la.lrange(label=[['a', 'b'], ['c', 'd']]) actual.lix[['b'], ['d']] = 9 desired = la.lrange(label=[['a', 'b'], ['c', 'd']]) desired[1, 1] = 9 ale(actual, desired)
def lix_setitem_test_06(): actual = la.lrange(label=[['a', 'b', 'c'], ['1', '2', '3']]) actual.lix[['a', 'b'], ['1', '2']] = 9 desired = la.lrange(label=[['a', 'b', 'c'], ['1', '2', '3']]) desired[:2, :2] = 9 ale(actual, desired)
def lix_setitem_test_08(): actual = la.lrange(label=[['a', 'b'], ['c', 'd']]) actual.lix[['a']] = la.larry([9, 10], [['c', 'd']]) desired = la.lrange(label=[['a', 'b'], ['c', 'd']]) desired[0] = [9, 10] ale(actual, desired)
def lix_setitem_test_10(): actual = la.lrange(label=[['a', 'b'], ['c', 'd']]) actual.lix[:, ['d']] = la.larry([[9], [10]], [['a', 'b'], ['d']]) desired = la.lrange(label=[['a', 'b'], ['c', 'd']]) desired[:, -1] = [9, 10] ale(actual, desired)
def test_lrange_1(self): a = lrange(5) d = larry([0, 1, 2, 3, 4]) ale(a, d, "lrange failed.")
def test_lrange_3(self): a = lrange((2, 2), dtype='f8') d = larry(np.array([0, 1, 2, 3], dtype='f8').reshape(2,2)) ale(a, d, "lrange failed.")
def lix_setitem_test_10(): actual = la.lrange(label=[['a', 'b'], ['c', 'd']]) actual.lix[:,['d']] = la.larry([[9], [10]], [['a', 'b'],['d']]) desired = la.lrange(label=[['a', 'b'], ['c', 'd']]) desired[:,-1] = [9, 10] ale(actual, desired)