Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and add test to ensure proper handling of merges by adjust_partition function #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kbegany
Copy link

@kbegany kbegany commented Jun 23, 2013

  1. Adjusted variables after merges in the adjust_partition function in modularity.py
    This was necessary because the mapping of the GraphPartition "index" may no longer match the adjust_partition "node_map" dictionary, due to changes in module numbering after merges.
  2. Added check for proper handling of merges to the "test_adjust_partition" function in test_modularity.py.

@@ -388,12 +388,12 @@ def node_update(self, n, m1, m2):
#Compute the change in modularity
return (e1[m1]-a1[m1]**2) + (e1[m2]-a1[m2]**2) - mod_old

def compute_node_update(self, n, m1, m2):
def compute_node_update(self, node, m1, m2):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the more explicit names!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants