xgi icon indicating copy to clipboard operation
xgi copied to clipboard

Consistency in dealing with empty edges

Open nwlandry opened this issue 1 year ago • 0 comments

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 access list(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(), and remove_node_from_edge(): these functions delete edges if removing a node creates an empty edge.

nwlandry avatar Jun 14 '23 17:06 nwlandry