Pythonflow.py Script

46 views
Skip to first unread message

Paul

unread,
Jun 6, 2012, 1:45:10 PM6/6/12
to Connectivity Analysis Toolkit
Hello. Is anyone running Pythonflow.py with scripting or on Linux
(i.e., not the .exe)? I have no problem with running the
pythonflow.exe but when scripting I get an error with this line:

>>> import xml.etree.cElementTree


Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import xml.etree.cElementTree
File "D:\Python26\ArcGIS10.0\lib\xml\etree\cElementTree.py", line 3,
in <module>
from _elementtree import *
ImportError: DLL load failed: %1 is not a valid Win32 application.
>>>

As you can see I'm running the Python2.6 installed with ArcGIS so the
cElementTree package is bundled with that 32bit install. Anyone else
seen this error? I was doing some testing before trying to run the
script in Linux -- if anyone has insight that would be great!

Cheers!

carlos

unread,
Jun 6, 2012, 2:07:04 PM6/6/12
to Connectivity Analysis Toolkit
Paul - Sorry you are encountering this problem.
I can confirm that the script works in Python 2.7 but don't have much
experience with the ArcGIS Python install.
But when I run the Python26.exe bundled with ArcGIS I do not get this
error.
Maybe a problem with environment variables eg, pythonpath?

Paul

unread,
Jun 7, 2012, 10:48:38 AM6/7/12
to Connectivity Analysis Toolkit
Carlos, thanks for following up.

I assume my python windows install is a rabbit hole so I moved on.
I have the program (pythonflow) running corrently on Linux as long as
the alpha = 0. However, when a != 0 it throws this error:

>>>>>>
File "pythonflow.py", line 74, in <module>

output=nx.approximate_current_flow_betweenness_centrality(G,normalized=True,epsilon=options.alpha)
AttributeError: 'module' object has no attribute
'approximate_current_flow_betweenness_centrality'


I had a look at the networkx module (1.1) and didn't notice a
submodule that included
'approximate_current_flow_betweenness_centrality'.

Clearly I am missing something here. Could it be a parameterization
problem?
Execution: pythonflow.py -c -a0.2 <input.txt> <output.txt>

thanks!

carlos

unread,
Jun 7, 2012, 11:50:11 AM6/7/12
to Connectivity Analysis Toolkit
This function is new in networkx v1.6, do you have that version
installed?

Paul

unread,
Jun 8, 2012, 8:03:31 AM6/8/12
to Connectivity Analysis Toolkit
Thanks Carlos!

Paul

unread,
Jun 10, 2012, 3:33:22 PM6/10/12
to Connectivity Analysis Toolkit
Hello Carlos,

Do you think NetworkX, like LEMON, is amenable to parallelism or
multithreading?  Specifically, I'm interested in flow betweenness
centrality calculations.

Cheers!


On Jun 7, 11:50 am, carlos <klamathconservat...@gmail.com> wrote:

carlos

unread,
Jun 10, 2012, 3:50:42 PM6/10/12
to Connectivity Analysis Toolkit
Aric Hagberg, NetworkX's developer, is pretty responsive to questions
on the Networkx-discuss google group, and could better answer that
question.
We were getting use of multiple _cores_ on current flow betweenness
centrality calculations previously (with Intel MKL version of numpy),
but I don't believe that's true with the current version anymore.
Aspects of the centrality algorithms as currently coded seem to make
it difficult to derive much benefit from using multiple threads.
Actually, on a related topic, our current multi-threading of LEMON is
not efficient, the LEMON developers are hoping for better support for
multiple threads in the next version.
From your mention of flow betweenness, I'm not sure if you are
planning on using one of the LEMON or Networkx-based functions, as
flow betweenness to me indicates use of the LEMON maximum flow
functions (although some of these have since been implemented in
NetworkX).
Reply all
Reply to author
Forward
0 new messages