HyperNetX icon indicating copy to clipboard operation
HyperNetX copied to clipboard

add_edge and add_node_to_edge not included in Hypergraph class

Open LucaGherardini opened this issue 2 years ago • 5 comments

Hello, I am trying to manually add edges to a hypergraph 'H'. First, I tried H.edges.add(), but it didn't show it in the edges list. I then read the documentation and in entity.py it says to use Hypergraph.add_edge or Hypergraph.add_node_to_edge instead, but none of the two is defined in the Hypergraph class, so they are not callable by H. Am I missing something?

LucaGherardini avatar Jun 07 '23 09:06 LucaGherardini

P.S.: The only invocation I found in the repository was in hypernetx/classes/tests/test_hypergraph.py, others were only comments. In this test, it says (line 65)

"Deprecated method; will support in later release"

And, except the fact that deprecated and future release are somewhat opposite to each other, I don't understand why it has been kept in the documentation of the methods, and why a currently way of adding nodes is not available.

LucaGherardini avatar Jun 07 '23 09:06 LucaGherardini

@LucaGherardini You are correct, kind of a silly sentence. The add functionality is on our list for July. Please stay tuned.

bpraggastis avatar Jun 07 '23 23:06 bpraggastis

@LucaGherardini You are correct, kind of a silly sentence. The add functionality is on our list for July. Please stay tuned.

What's the status on the add_edge functionality?

markwgirard avatar Nov 26 '23 19:11 markwgirard

@markwgirard @LucaGherardini We are still working on the new release with the add_edge functionality. There were a number of bugs in the 2.0 version that are gradually being repaired and updated as hot fixes. Once the data structures introduced in 2.0 are stable, we will add in the add/remove functionality. Keep watch, we hope to have it within a month or two. Thanks for your patience.

brendapraggastis avatar Nov 26 '23 23:11 brendapraggastis

@markwgirard @LucaGherardini We are still working on the new release with the add_edge functionality. There were a number of bugs in the 2.0 version that are gradually being repaired and updated as hot fixes. Once the data structures introduced in 2.0 are stable, we will add in the add/remove functionality. Keep watch, we hope to have it within a month or two. Thanks for your patience.

Any updates on this add_edge function?

yb-hitsz avatar Feb 26 '24 12:02 yb-hitsz

add_nodes_to_edges(edge_dict, inplace=True) has modify / add_new semantics, depending on whether edge_id in edge_dict already exists or not.

We need a method with add_new semantics such that if edge_id already exists, it will be assigned a new one.

dtchang avatar Jun 13 '24 21:06 dtchang

@dtchang Our decision was to use existing names first and only create a new object if it doesn't already exist. You can check if an id is in use or use rename to rename the nodes and edges using the Hypergraph.rename method

brendapraggastis avatar Aug 08 '24 06:08 brendapraggastis