Comments (8)
I ran the tests with nose and got this trace:
.............F.F......../usr/local/lib/python3.4/dist-packages/bctpy-0.4.0-py3.4.egg/bct/bct.py:187: RuntimeWarning: invalid value encountered in true_divide
pnm=Snm/(np.tile(S,(m,1)).T)
..EE.....F..F...../usr/local/lib/python3.4/dist-packages/bctpy-0.4.0-py3.4.egg/bct/bct.py:689: RuntimeWarning: invalid value encountered in true_divide
P=np.ones((n,))-Sc2/np.square(S)
../usr/local/lib/python3.4/dist-packages/bctpy-0.4.0-py3.4.egg/bct/bct.py:2876: RuntimeWarning: invalid value encountered in double_scalars
dc = (mc - min_mc) / (nc*(nc-1)/2 - min_mc) #community density
E
======================================================================
ERROR: modularity_tests.test_modularity_louvain_und
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/home/cbarnes/code/lib/bctpy/test/modularity_tests.py", line 17, in test_modularity_louvain_und
_,q = bct.modularity_louvain_und(x, seed=seed)
File "/usr/local/lib/python3.4/dist-packages/bctpy-0.4.0-py3.4.egg/bct/bct.py", line 3581, in modularity_louvain_und
ci[h][np.where(ci[h-1]==i+1)]=mi #assign new modules
NameError: name 'mi' is not defined
======================================================================
ERROR: modularity_tests.test_modularity_finetune_und
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/home/cbarnes/code/lib/bctpy/test/modularity_tests.py", line 50, in test_modularity_finetune_und
ci,oq = bct.modularity_louvain_und(x, seed=seed)
File "/usr/local/lib/python3.4/dist-packages/bctpy-0.4.0-py3.4.egg/bct/bct.py", line 3581, in modularity_louvain_und
ci[h][np.where(ci[h-1]==i+1)]=mi #assign new modules
NameError: name 'mi' is not defined
======================================================================
ERROR: very_long_tests.test_link_communities
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/home/cbarnes/code/lib/bctpy/test/very_long_tests.py", line 8, in test_link_communities
M = bct.link_communities(x)
File "/usr/local/lib/python3.4/dist-packages/bctpy-0.4.0-py3.4.egg/bct/bct.py", line 2892, in link_communities
u1,u2 = np.where( ES[np.ix_(U,U)]==np.max(ES[np.ix_(U,U)]) )
File "/usr/local/lib/python3.4/dist-packages/bctpy-0.4.0-py3.4.egg/bct/bct.py", line 2892, in link_communities
u1,u2 = np.where( ES[np.ix_(U,U)]==np.max(ES[np.ix_(U,U)]) )
File "/usr/lib/python3.4/bdb.py", line 48, in trace_dispatch
return self.dispatch_line(frame)
File "/usr/lib/python3.4/bdb.py", line 66, in dispatch_line
self.user_line(frame)
File "/usr/lib/python3.4/pdb.py", line 259, in user_line
self.interaction(frame, None)
File "/usr/lib/python3.4/pdb.py", line 346, in interaction
self._cmdloop()
File "/usr/lib/python3.4/pdb.py", line 319, in _cmdloop
self.cmdloop()
File "/usr/lib/python3.4/cmd.py", line 126, in cmdloop
line = input(self.prompt)
nose.proxy.TypeError: bad argument type for built-in operation
-------------------- >> begin captured stdout << ---------------------
hierarchy 0
hierarchy 1
hierarchy 2
hierarchy 3
hierarchy 4
hierarchy 5
hierarchy 6
> /usr/local/lib/python3.4/dist-packages/bctpy-0.4.0-py3.4.egg/bct/bct.py(2892)link_communities()
-> u1,u2 = np.where( ES[np.ix_(U,U)]==np.max(ES[np.ix_(U,U)]) )
--------------------- >> end captured stdout << ----------------------
======================================================================
FAIL: core_tests.test_threshold_proportional
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/home/cbarnes/code/lib/bctpy/test/core_tests.py", line 8, in test_threshold_proportional
assert np.allclose( np.sum(x), 22548.51206965 )
AssertionError
======================================================================
FAIL: core_tests.test_threshold_proportional_directed
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/home/cbarnes/code/lib/bctpy/test/core_tests.py", line 18, in test_threshold_proportional_directed
assert np.allclose( np.sum(x), 32852.72485433 )
AssertionError
======================================================================
FAIL: modularity_tests.test_modularity_finetune_dir_low_modularity
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/home/cbarnes/code/lib/bctpy/test/modularity_tests.py", line 144, in test_modularity_finetune_dir_low_modularity
assert q >= oq
nose.proxy.AssertionError:
-------------------- >> begin captured stdout << ---------------------
0.0692747009074 0.0694071961372
--------------------- >> end captured stdout << ----------------------
======================================================================
FAIL: modularity_tests.test_modularity_finetune_dir
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/home/cbarnes/code/lib/bctpy/test/modularity_tests.py", line 166, in test_modularity_finetune_dir
assert q >= oq
nose.proxy.AssertionError:
-------------------- >> begin captured stdout << ---------------------
0.359308571478 0.359820950972
--------------------- >> end captured stdout << ----------------------
----------------------------------------------------------------------
Ran 45 tests in 172.041s
FAILED (errors=3, failures=4)
So it looks like the failures are due to small float inequalities (although you'd know better than me if they're important). The errors may be more tricky as it seems like enumerate is failing to produce a variable...
from bctpy.
A few of the errors are my fault. In fact in one or two of the complex modularity tests, the test case has never passed -- it should in principle pass, but I think the math crumbles in the edge case given.
I created a branch called py3
that you can push to. I'll look at the test cases that are still failing and see what I can do. But, if I can't fix it easily, I have a relatively limited supply of effort to spend on supporting python 3, it is not a huge priority of mine.
from bctpy.
I get that. As the dependencies are pretty thin I suspect there shouldn't be too much to fix (which I can pitch in on once you've zeroed in on the actual red tests), and most 2.7 code can be written in such a way as to be future-compatible if you're still expanding the codebase and don't mind a couple of extra lines to support users of the present and future version of the language.
from bctpy.
I fixed some outstanding bugs in some lesser used modularity functions that were causing some of the errors to be thrown (which were not related to python 3, I just forgot to propagate the fixes to a previous bug).
The errors ostensibly caused by python 3 conversion which I haven't traced down are in threshold_proportional and link_communities.
link_communities is an extremely long-runtime function which I ported directly from the matlab code. It is very inefficient and the python implementation is even slower than the matlab version. Not sure if your test case crashed because it ran too long or for some other system reason. It isn't very important because it is somewhat experimental and redundant; most users would probably opt to use much faster algorithms that accomplishing something similar such as modularity_und.
It makes little sense why threshold_proportional and related would fail with assertion errors. That function is important.
from bctpy.
Thanks, I'll get them merged in to my branches and see if it's anything I can manage.
I've been playing with TravisCI today and have got the build deploying but the tests are crashing out after a long hold (10+ minutes), which is odd as they pass/fail quite quickly on my local machine. I'll raise an issue on my own fork. Do any of the tests use mayavi? That would be tricky to install on travis.
from bctpy.
I can't see a py3 branch - maybe it doesn't make the branch visible if there are no changes?
from bctpy.
No tests use mayavi.
I don't know how branches work very well on github. I tried to make a branch on github but not on my local repository and I guess it did nothing. Anyway now I added a commit to this branch which adds a whitespace character to the readme.
from bctpy.
Remaining python 3 tests pass. Master branched merged with py3 branch.
Old code available under py2-stable branch in case of likely obscure bugs.
from bctpy.
Related Issues (20)
- B symmetrization inside if statement in community_louvain
- IndexError: index 2278 is out of bounds for axis 0 with size 2278 HOT 3
- bug: findwalks's for loop index is wrong at it's onset HOT 1
- Wrong description in `kcoreness_centrality_bu` HOT 1
- Update `get_rng` to return Generator instances
- Different implementations to compute global efficiency using bct.charpath and bct.efficiency_wei unclear HOT 1
- Does bct.efficiency_wei also work for directed networks? HOT 1
- Improve generalizability of partition_distance()
- No fucntion get_components.py inside module .algorithms? HOT 1
- Autofix(): Indexing error
- Issue with weighted transitivity and clustering coefficient? HOT 1
- Problem to run bct.modularity_dir with latest numpy HOT 1
- bct.charpath does not exclude 'Infs' in the distance matrix as mentioned in the documentation HOT 1
- Permutation max = 0 at stringent t-thresholds
- Official `bctpy` on `conda-forge` HOT 7
- local_assortativity_wu_sign not separating signs properly
- NBS covariates
- NBS parallel
- Release 0.6.1 missing tar.gz on Pipy HOT 1
- Implement bct.kcoreness_centrality_wu
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bctpy.