pnnl / HyperNetX

Python package for hypergraph analysis and visualization.
https://hypernetx.readthedocs.io
Other
553 stars 92 forks source link

remove.singletons deletes weights #89

Closed aminaazaiez closed 1 year ago

aminaazaiez commented 2 years ago

When I used algorithms.hypergraph_modularity.precompute_attributes , I realized that this function resets hyperedges weights to the unit weight. I seems that the problem comes from the first line H = HG.remove_singletons(). This function seems to not copy the original weights. When I delete this first line H = HG.remove_singletons() from the source code of precompute_attributes ,it works well.

madelynshapiro commented 2 years ago

Thank you for raising this issue with remove_singletons; it will be fixed in our next release.

bonicim commented 1 year ago

The issue with algorithms.hypergraph_modularity.precompute_attributes has been addressed in release 2.0.0. For reference, the updated function can be viewed at https://github.com/pnnl/HyperNetX/blob/master/hypernetx/algorithms/hypergraph_modularity.py#L79-L129.