def test_update_tag_pure_deletion(self): tags = np.arange(3) g = TagClass(tags) delete_face = [0] new_face = [[]] non_conforming.update_face_tags(g, delete_face, new_face) known_tag = np.array([1, 2]) assert np.allclose(known_tag, g.face_tags)
def test_update_tag_two_to_many(self): tags = np.arange(3) g = TagClass(tags) delete_face = [0, 2] new_face = [[2, 3], [4]] non_conforming.update_face_tags(g, delete_face, new_face) known_tag = np.array([1, 0, 0, 2]) assert np.allclose(known_tag, g.face_tags)
def test_update_tag_two_to_many(self): n_tags = 3 g = TagClass(n_tags) g.tags["tip_faces"] = np.array([True, False, False]) delete_face = [0, 2] new_face = [[2, 3], [4]] non_conforming.update_face_tags(g, delete_face, new_face) known_tag = np.array([False, True, True, False]) # np.array([1, 0, 0, 2]) self.assertTrue(np.allclose(known_tag, g.tags["tip_faces"]))
def test_update_tag_pure_deletion(self): n_tags = 3 g = TagClass(n_tags) g.tags['tip_faces'] = np.array([False, True, False]) delete_face = [0] new_face = [[]] non_conforming.update_face_tags(g, delete_face, new_face) known_tag = np.array([True, False]) #np.array([1, 2]) assert np.allclose(known_tag, g.tags['tip_faces'])
def test_update_tag_simple(self): n_tags = 3 g = TagClass(n_tags) g.tags["tip_faces"] = np.array([True, False, False]) delete_face = [0] new_face = [[2]] non_conforming.update_face_tags(g, delete_face, new_face) known_tag = np.array([False, False, True]) # np.array([1, 2, 0]) self.assertTrue(np.allclose(known_tag, g.tags["tip_faces"]))