def test_ne(self): """PairMatrix test for inequality should check all elements""" p = self.ab_pairs a = PairMatrix.empty(p) b = PairMatrix.empty(p) c = PairMatrix([1,2,3,4], p) d = PairMatrix([1,2,3,4], p) assert a != c assert a == b assert c == d #Note: still compare equal if alphabets are different x = Alphabet('xy') x = x*x y = PairMatrix([1,2,3,4], x) assert y == c #should check all elements, not just first c = PairMatrix([1,1,1,1], p) d = PairMatrix([1,1,1,4], p) assert c != d
def test_ne(self): """PairMatrix test for inequality should check all elements""" p = self.ab_pairs a = PairMatrix.empty(p) b = PairMatrix.empty(p) c = PairMatrix([1, 2, 3, 4], p) d = PairMatrix([1, 2, 3, 4], p) assert a != c assert a == b assert c == d #Note: still compare equal if alphabets are different x = Alphabet('xy') x = x * x y = PairMatrix([1, 2, 3, 4], x) assert y == c #should check all elements, not just first c = PairMatrix([1, 1, 1, 1], p) d = PairMatrix([1, 1, 1, 4], p) assert c != d
def test_eq(self): """Pairmatrix test for equality should check all elements""" p = self.ab_pairs a = PairMatrix.empty(p) b = PairMatrix.empty(p) assert a is not b self.assertEqual(a, b) c = PairMatrix([1,2,3,4], p) d = PairMatrix([1,2,3,4], p) assert c is not d self.assertEqual(c, d) self.assertNotEqual(a, c) #Note: still compare equal if alphabets are different x = Alphabet('xy') x = x*x y = PairMatrix([1,2,3,4], x) self.assertEqual(y, c) #should check all elements, not just first c = PairMatrix([1,1,1,1], p) d = PairMatrix([1,1,1,4], p) assert c is not d self.assertNotEqual(c, d)
def test_eq(self): """Pairmatrix test for equality should check all elements""" p = self.ab_pairs a = PairMatrix.empty(p) b = PairMatrix.empty(p) assert a is not b self.assertEqual(a, b) c = PairMatrix([1, 2, 3, 4], p) d = PairMatrix([1, 2, 3, 4], p) assert c is not d self.assertEqual(c, d) self.assertNotEqual(a, c) #Note: still compare equal if alphabets are different x = Alphabet('xy') x = x * x y = PairMatrix([1, 2, 3, 4], x) self.assertEqual(y, c) #should check all elements, not just first c = PairMatrix([1, 1, 1, 1], p) d = PairMatrix([1, 1, 1, 4], p) assert c is not d self.assertNotEqual(c, d)
def test_empty(self): """PairMatrix empty classmethod should produce correct class""" p = PairMatrix.empty(self.ab_pairs) self.assertEqual(p._data.flat, array([0,0,0,0])) self.assertEqual(p._data, array([[0,0],[0,0]])) self.assertEqual(p._data.shape, (2,2))
def test_empty(self): """PairMatrix empty classmethod should produce correct class""" p = PairMatrix.empty(self.ab_pairs) self.assertEqual(p._data.flat, array([0, 0, 0, 0])) self.assertEqual(p._data, array([[0, 0], [0, 0]])) self.assertEqual(p._data.shape, (2, 2))