def remove_edges_related_to_element(self, element_name: str): element_name_adjusted = lower_and_drop_spaces(element_name) edges_to_remove = set() for edge in self._edges.adjusted_keys(): if element_name_adjusted in edge: edges_to_remove.add(edge) self.remove_edges(edges=edges_to_remove)
def element_type(self, value): element_type = lower_and_drop_spaces(value).capitalize() if element_type in self.valid_types: self._element_type = element_type else: raise ValueError('{} is not a valid Element Type'.format(value))