On 06/22/2011 09:15 AM, Sebastian Weber wrote:
Hi!
gPath_ind = [ eg2id[e] for e in egPath ] gPath_filt = g.new_vertex_property("bool") gPath_filt.a[:] = False gPath_filt.a[gPath_ind] = True gp = GraphView(g, vfilt=gPath_filt) gpl = GraphView(gp, vfilt=label_largest_component(gp)) path_lc = [ int(v) for v in gpl.vertices() ]
fails for some reason I don't see.
I guess the problem is a small quirk with label_largest_component(). The code above removes all but one vertex, which has index gPath_ind, from the graph (is this really what you want, BTW?). The function
gPath_ind is a list of indices of vertices I wanna keep in the filtered view of the graph, i.e. definitely more than one vertex. From that set of vertices I want to extract the largest component.
Oh, I see now. I misunderstood the first line of your code. But in any case, I think I had correctly identified the bug, which should always happen when the largest component has an index of zero. Could you see if things work now with the git version?
BTW, the newest graph-tool seems to compile and install just fine on MacOS. At least it brings its own DLFCN.py and hence installing out of the box.
What do you mean? I haven't included DLFCN.py anywhere... (I can't anyway, since it is platform-dependent code)
Hmm, I thought I deleted it manually, but obviously not. Anyway, if one puts the DLFCN.py into the graph-tool directory, it runs fine here. So I guess we should file a bug to macports regarding the python installation (in the meantime I reinstalled Xcode and python such that I have a proper macports installation of python 2.7).
Yes, we should file a bug report. There is no possible workaround we can do from graph-tool, since the contents of DLFCN.py will be different in each platform. Cheers, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>