-
Notifications
You must be signed in to change notification settings - Fork 28
Empty modules #3
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
Conversation
Also, turn empty module exceptions into a function call so we can gradually refactor that out and allow for empty modules.
modularity updates. The empty modules will be allowed without raising an exception, instead they will be immediately removed with a renaming of the remaining labels.
delta_energy_true) | ||
|
||
# Test that the nodes in the split modules are equal to the | ||
# original nodes of the module | ||
yield npt.assert_equal(np.sort(list(n1)), n1_new) | ||
yield npt.assert_equal(np.sort(list(n2)), n2_new) | ||
npt.assert_equal(np.sort(list(n1)), n1_new) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this is related to your changes, but this test periodically fails for me, and look like it is the order of the list (both are NOT sorted), but it is random. One time it passes, another it fails
Here is the traceback
FAIL: Test the GraphPartition operation that splits modules so that it returns
Traceback (most recent call last):
File "/usr/local/epd/lib/python2.7/site-packages/nose-1.3.0-py2.7.egg/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/jagust/cindeem/CODE/brainx/brainx/tests/test_modularity.py", line 637, in test_apply_module_split
npt.assert_equal(np.sort(list(n1)), n1_new)
File "/usr/local/epd/lib/python2.7/site-packages/numpy/testing/utils.py", line 256, in assert_equal
return assert_array_equal(actual, desired, err_msg, verbose)
File "/usr/local/epd/lib/python2.7/site-packages/numpy/testing/utils.py", line 707, in assert_array_equal
verbose=verbose, header='Arrays are not equal')
File "/usr/local/epd/lib/python2.7/site-packages/numpy/testing/utils.py", line 636, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Arrays are not equal
(mismatch 100.0%)
x: array([2, 8])
y: array([8, 2])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hadn't seen this particular failure yet, but you're totally right that it can happen. I just pushed 516ae19 with a fix to ensure the comparison is done on sorted lists.
Remove old parametric testing from test suite, add functionality for dealing with empty partitions in modularity.py
excellent, thanks! |
Remove old parametric testing from test suite, add functionality for dealing with empty partitions in modularity.py
Start making changes for better management of empty modules.
Also cleaned up a lot of the parametric test machinery.
Note: there are some warnings about NaNs in there that we still need to clean up, but now at least the test suite passes cleanly again.