Closed jim-rafferty closed 3 years ago
Thanks Jim! Great to have you contributing. :) We will review the changes and let you know how we will incorporate them.
Upon reflection, I think the right way to handle weights in __incidence_to_adjacency
is to pass in M
for unweighted hypergaphs and M.dot(np.diag(weight))
for weighted hypergraphs, rather than handling the weighted case inside the __incidence_to_adjacency
function. That way it should work for the hypergraph and the dual hypergraph without modification.
@jim-rafferty Could you push a branch to the repository and make a pull request to develop from the branch? We need to pull and test before we can integrate. Thanks.
Hi @brendapraggastis , just so I'm clear about what you want me to do:
Fork pnnl/HyperNetX to jim-rafferty/HyperNetX create a new branch in jim-rafferty/HyperNetX and push changes to that branch Send you a PR for those changes so they are not automatically merged into master.
Just a thumbs up is fine if this is right, thanks :)
@jim-rafferty That sounds right. You are the second outside contributor to the project and the first from outside the Lab so we are still working on protocols. We are also creating a major rewrite for scaling HNX to larger hypergraphs, so stay tuned. Hopefully you will see a major lift by Christmas.
Oh, I reset the head of the master back to where it started and it automatically closed the PR?! Cool! :)
That's great to hear about being the first outside contributor to the project. I hope it goes well, and paves the way for more people to be involved going forward. I will open another PR with the code in a new branch.
Hi,
I thought I would try to make it a bit easier to create a weighted hypergraph, using a similar syntax to that in networkx. Now you can add weighted edges like this:
I've also added support for calculating the weighted node adjacency matrix:
I have an issue with the edge adjacency matrix, because I would ordinarily calculate it with the following matrix formula: \sqrt(W) M^T M * \sqrt(W), but this won't currently work as
edge_adjacency_matrix
calls__incidence_to_adjacency
, the same method as is called byadjacency_matrix
. I would be grateful for your thoughts on this, I've currently left the weighted edge adjacency to throw aNotImplementedError
.All of these changes play quite nicely with the existing code, but I wanted to submit them for your consideration before doing too much more.
Many thanks. :)