def test_remove_invalid_efms_content(self): N = np.array([[-1, 0, -1, 0], [1, -1, 0, 0], [0, 1, 1, 1], [0, 0, 0, -1]]) V = np.array([[1, 0, 1], [1, 0, 0], [-1, 10, 0], [0, 10, 0]]) v_new = remove_invalid_efms(N, V)[:, 0] self.assertListEqual(list(V[:,0]), list(v_new), 'EFM 0 was supposed to be valid')
def test_remove_invalid_efms_shape(self): N = np.array([[-1, 0, -1, 0], [1, -1, 0, 0], [0, 1, 1, 1], [0, 0, 0, -1]]) V = np.array([[1, 0, 1], [1, 0, 0], [-1, 10, 0], [0, 10, 0]]) V_new = remove_invalid_efms(N, V) self.assertTupleEqual((4, 1), V_new.shape, 'Was supposed to get 4x1 V, got %s' % [str(it) for it in V_new.shape])