nipy / brainx

Tools for analysis of brain imaging-derived networks, based on NetworkX

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is this error due to the use of a newer networkx version ?

rsblume opened this issue · comments

Hi Guys,
Installed Brainx on my UCI setup. We are running canopy. I have networkx 1.8.1-2 installed in my session. I get the error below. I think this is networkx version issue.
mod.simulated_annealing(pfc_graph). Is this correct? What version should I be using? Currently trying to get nx 1.6 installed


ValueError Traceback (most recent call last)
in ()
----> 1 mod.simulated_annealing(pfc_graph)

/home/rblumenf/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/brainx-0.1.dev-py2.7.egg/brainx/modularity.pyc in simulated_annealing(g, p0, temperature, temp_scaling, tmin, bad_accept_mod_ratio_max, bad_accept_nod_ratio_max, accept_mod_ratio_min, accept_nod_ratio_min, extra_info, debug)
1063 # make a graph partition object
1064 if p0 is None:
-> 1065 graph_partition = GraphPartition(g,part)
1066 else:
1067 graph_partition = p0

/home/rblumenf/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/brainx-0.1.dev-py2.7.egg/brainx/modularity.pyc in init(self, graph, index)
79
80 # Now, build the edge information used in modularity computations
---> 81 self.mod_e, self.mod_a = self._edge_info()
82
83

/home/rblumenf/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/brainx-0.1.dev-py2.7.egg/brainx/modularity.pyc in _edge_info(self, mod_e, mod_a, index)
113 #looks like a set when we read it in ipython
114 mat_within = mat[modnodes,:][:,modnodes]
--> 115 mat_between = mat[modnodes,:][:,btwnnodes]
116 perc_within = mat_within.sum() * norm_factor
117 perc_btwn = mat_between.sum() * norm_factor

/home/rblumenf/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyc in getitem(self, index)
314
315 try:
--> 316 out = N.ndarray.getitem(self, index)
317 finally:
318 self._getitem = False

ValueError: invalid literal for long() with base 10: '24d

Hi Rob,

I don't think so. We're running 1.8.1 here and I just ran some of this code
last week without a problem. Looks like 1.8.1 was released last August
(2013), so we've probably been using it for a bit.

Happy to look at other aspects of what you're running to track down the
problem!
Courtney

On Tue, Jun 17, 2014 at 4:58 PM, rsblume notifications@github.com wrote:

Hi Guys,
Installed Brainx on my UCI setup. We are running canopy. I have networkx
1.8.1-2 installed in my session. I get the error below. I think this is
networkx version issue.
mod.simulated_annealing(pfc_graph). Is this correct? What version should I

be using? Currently trying to get nx 1.6 installed

ValueError Traceback (most recent call last)
in ()
----> 1 mod.simulated_annealing(pfc_graph)

/home/rblumenf/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/brainx-0.1.dev-py2.7.egg/brainx/modularity.pyc
in simulated_annealing(g, p0, temperature, temp_scaling, tmin,
bad_accept_mod_ratio_max, bad_accept_nod_ratio_max, accept_mod_ratio_min,
accept_nod_ratio_min, extra_info, debug)
1063 # make a graph partition object
1064 if p0 is None:
-> 1065 graph_partition = GraphPartition(g,part)
1066 else:
1067 graph_partition = p0

/home/rblumenf/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/brainx-0.1.dev-py2.7.egg/brainx/modularity.pyc
in init(self, graph, index)
79
80 # Now, build the edge information used in modularity computations
---> 81 self.mod_e, self.mod_a = self._edge_info()
82
83

/home/rblumenf/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/brainx-0.1.dev-py2.7.egg/brainx/modularity.pyc
in _edge_info(self, mod_e, mod_a, index)
113 #looks like a set when we read it in ipython
114 mat_within = mat[modnodes,:][:,modnodes]
--> 115 mat_between = mat[modnodes,:][:,btwnnodes]
116 perc_within = mat_within.sum() * norm_factor
117 perc_btwn = mat_between.sum() * norm_factor

/home/rblumenf/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyc
in getitem(self, index)
314
315 try:
--> 316 out = N.ndarray.getitem(self, index)
317 finally:
318 self._getitem = False

ValueError: invalid literal for long() with base 10: '24d


Reply to this email directly or view it on GitHub
#23.

Courtney Gallen
Graduate Student
Helen Wills Neuroscience Institute
University of California, Berkeley
clg5026@berkeley.edu

Hi Courtney, Thanks! I figured it out. I cloned/installed an old version of brainx. Doh. Easy fix nonetheless. Good to know about the nx version. I'll close the issue.