xgi
xgi copied to clipboard
Consistency in dealing with empty edges
Currently, some XGI methods support empty edges and some do not.
Ones that do:
-
dual()
: the dual of a hypergraph with isolated nodes must have empty edges. -
add_edges_from()
so long as the empty edges is not first and if it is, it raises an IndexError as it tries to accesslist(first_edge)[0]
(in the case of a list of sets)
Ones that do not:
-
add_edge()
: this raises an XGIError for an empty edge. -
remove_nodes_from()
,remove_node()
, andremove_node_from_edge()
: these functions delete edges if removing a node creates an empty edge.