Skip to content

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

Merged
merged 3 commits into from
May 30, 2013
Merged

Empty modules #3

merged 3 commits into from
May 30, 2013

Conversation

fperez
Copy link
Contributor

@fperez fperez commented May 29, 2013

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.

fperez added 2 commits April 25, 2013 15:20
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)
Copy link
Contributor

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])

Copy link
Contributor Author

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.

cindeem pushed a commit that referenced this pull request May 30, 2013
Remove old parametric testing from test suite, add functionality for dealing with empty partitions in modularity.py
@cindeem cindeem merged commit a9fd05a into master May 30, 2013
@fperez
Copy link
Contributor Author

fperez commented May 30, 2013

excellent, thanks!

kbegany added a commit that referenced this pull request Jul 30, 2015
Remove old parametric testing from test suite, add functionality for dealing with empty partitions in modularity.py
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.

2 participants