def _test_basic_properties(coltype): dm = DataMatrix(length=4, default_col_type=coltype) dm.c = 3, 1, 2, 3 dm.d = dm.c dm.e = 3, 1, 2, 3 eq_(dm.c.name, ['c', 'd']) eq_(dm.d.name, ['c', 'd']) eq_(dm.e.name, 'e') eq_(list(dm.c.unique), [1, 2, 3]) eq_(dm.c.count, 3)
def _test_basic_properties(coltype): dm = DataMatrix(length=4, default_col_type=coltype) dm.c = 3, 1, 2, 3 dm.d = dm.c dm.e = 3, 1, 2, 3 assert dm.c.name == ['c', 'd'] assert dm.d.name == ['c', 'd'] assert dm.e.name == 'e' assert list(dm.c.unique) == [1, 2, 3] assert dm.c.count == 3
def _test_copying(cls): dm = DataMatrix(length=5) dm.d = cls dm2 = dm[:] dm2.e = dm.d dm2.f = dm2.d ok_(dm2 is not dm) ok_(dm2.d is not dm.d) ok_(dm2.e is not dm.d) ok_(dm2.f is dm2.d) ok_(dm2.d._seq is not dm.d._seq) dm.c = dm.d ok_(dm.c is dm.d) ok_(dm.c._seq is dm.d._seq) dm.e = dm.d[:] ok_(dm.e is not dm.d) ok_(dm.e._seq is not dm.d._seq) check_integrity(dm) check_integrity(dm2)