def test_normalize(self): """Rates normalize should return normalized copy of self where trace=-1""" r = Rates([-2,1,1,0,-1,1,2,0,-1], self.abc_pairs) n = r.normalize() self.assertEqual(n._data, \ array([[-0.5,.25,.25],[0.,-.25,.25],[.5,0.,-.25]])) #check that we didn't change the original assert n._data is not r._data self.assertEqual(r._data, \ array([[-2,1,1,],[0,-1,1,],[2,0,-1]]))
def test_normalize(self): """Rates normalize should return normalized copy of self where trace=-1""" r = Rates([-2, 1, 1, 0, -1, 1, 2, 0, -1], self.abc_pairs) n = r.normalize() self.assertEqual(n._data, \ array([[-0.5,.25,.25],[0.,-.25,.25],[.5,0.,-.25]])) #check that we didn't change the original assert n._data is not r._data self.assertEqual(r._data, \ array([[-2,1,1,],[0,-1,1,],[2,0,-1]]))