xgi-org / xgi

CompleX Group Interactions (XGI) is a Python package for higher-order networks.
https://xgi.readthedocs.io
Other
187 stars 32 forks source link

Support DiHypergraph in from_bipartite_graph #625

Open colltoaction opened 1 week ago

colltoaction commented 1 week ago

Hi, do you think it's possible to support DiHypergraphs in this API?

https://github.com/xgi-org/xgi/blob/139a2bc5f1cff7f77090d1e7b882821833b7fe0b/xgi/convert/bipartite_graph.py#L12

I can try to implement it but I wonder what the API would look like. Likely something compatible with HIF.

nwlandry commented 1 week ago

@colltoaction --- this is a great idea! Do you want to take the lead on this? If not, happy to give it a try.

colltoaction commented 1 week ago

Definitely! I'm thinking I can use the nx.Graph attributes like the HIF top-level metadata:

https://github.com/xgi-org/xgi/blob/0726fe1ca99b80fd57058d569ed8f6e1a2ee9b01/xgi/readwrite/hif.py#L138-L146

I would like to implement DiHypergraphs for from_bipartite at the moment, but there is more work to do for feature parity.