def _check_tags(self) -> None: for key in tags.standard_node_tags(): if key not in self.tags.keys(): raise ValueError(f"The tag key {key} must be specified") value = self.tags.get(key) if not value.size == self.num_nodes: raise ValueError(f"Wrong size of value for tag {key}") for key in tags.standard_face_tags(): if key not in self.tags.keys(): raise ValueError(f"The tag key {key} must be specified") value = self.tags.get(key) if not value.size == self.num_faces: raise ValueError(f"Wrong size of value for tag {key}")
def initiate_node_tags(self) -> None: keys = tags.standard_node_tags() values = [np.zeros(self.num_nodes, dtype=bool) for _ in keys] tags.add_tags(self, dict(zip(keys, values)))