Executing functions on a GraphView
Hi! what is the graph-toolic way of working with a GraphView other than for drawing? I find the filtering functionality pretty neat and would like to do things like babo = load_graph('babonet.gt') babo_in_hist = vertex_hist(babo, 'in') chabo = GraphView(g, efilt=lambda e: g.ep.chabo_prop[e] == 'WISSEN_WER') chabo_in_hist = vertex_hist(chabo, 'in') Yet babo_in_hist == chabo_in_hist evaluates to True, which makes sense because chabo knows who the babo is (they share the same basis data). I can come up with a way of building an extra network based on the GraphView, but this seems like something somebody else has already needed so I figured I better ask first (obviously after having checked the mailing list archive ;) ) Have a nice weekend everybody! Juan Dominguez-Moran ________________________________________ Von: graph-tool <graph-tool-bounces@skewed.de> im Auftrag von graph-tool-request@skewed.de <graph-tool-request@skewed.de> Gesendet: Freitag, 5. Oktober 2018 12:00 An: graph-tool@skewed.de Betreff: graph-tool Digest, Vol 129, Issue 3 Send graph-tool mailing list submissions to graph-tool@skewed.de To subscribe or unsubscribe via the World Wide Web, visit https://lists.skewed.de/mailman/listinfo/graph-tool or, via email, send a message with subject or body 'help' to graph-tool-request@skewed.de You can reach the person managing the list at graph-tool-owner@skewed.de When replying, please edit your Subject line so it is more specific than "Re: Contents of graph-tool digest..." Today's Topics: 1. Re: Unable to import centrality function (Ozgun Altunkaya) 2. Re: Unable to import centrality function (ashutosh) ---------------------------------------------------------------------- Message: 1 Date: Thu, 4 Oct 2018 21:24:58 +0300 From: Ozgun Altunkaya <altunkayao@itu.edu.tr> To: graph-tool@skewed.de Subject: Re: [graph-tool] Unable to import centrality function Message-ID: <9c039269-5d2b-9799-f559-ba688b4e6b51@itu.edu.tr> Content-Type: text/plain; charset=utf-8; format=flowed Hi, I don't think you're supposed to do "gt.centrality.eigenvector(MyGraph)". Did you try "gt.eigenvector(MyGraph)"? On 10/4/18 8:08 AM, ashutosh wrote:
Sir,
I am unable to import centrality function from the graph tool package
*import graph_tool as gt*
*gt.centrality.eigenvector(myGraph)*
gives the following error:
*AttributeError: module 'graph_tool' has no attribute 'centrality'*
I tried after restarting my Spyder IDE but the issue remains
I am using graph tool version '2.27 (commit ce258562, Thu Jun 28 14:29:44 2018 +0100)'
OS: Linux (Ubuntu 64bit)
-- Sent from: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/ _______________________________________________ graph-tool mailing list graph-tool@skewed.de https://lists.skewed.de/mailman/listinfo/graph-tool
------------------------------ Message: 2 Date: Thu, 4 Oct 2018 20:20:59 -0700 (MST) From: ashutosh <ashuein@gmail.com> To: graph-tool@skewed.de Subject: Re: [graph-tool] Unable to import centrality function Message-ID: <1538709659461-0.post@n3.nabble.com> Content-Type: text/plain; charset=us-ascii Yes, I tried this too but it doesn't work. *gt.eigenvector(MyGraph)* doesn't work. It's not listed in the list of modules inside graph_tool package. Also documentation specifically mentions *graph_tool.centrality.eigenvector(g, weight=None, vprop=None, epsilon=1e-06, max_iter=None)* that is the command has to be called inside the centrality module of graph tool package. -- Sent from: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/ ------------------------------ Subject: Digest Footer _______________________________________________ graph-tool mailing list graph-tool@skewed.de https://lists.skewed.de/mailman/listinfo/graph-tool ------------------------------ End of graph-tool Digest, Vol 129, Issue 3 ******************************************
Am 05.10.18 um 20:01 schrieb Dominguez Morán, Juan Manuel:
Hi!
what is the graph-toolic way of working with a GraphView other than for drawing?
I find the filtering functionality pretty neat and would like to do things like
babo = load_graph('babonet.gt') babo_in_hist = vertex_hist(babo, 'in') chabo = GraphView(g, efilt=lambda e: g.ep.chabo_prop[e] == 'WISSEN_WER') chabo_in_hist = vertex_hist(chabo, 'in')
Yet babo_in_hist == chabo_in_hist evaluates to True, which makes sense because chabo knows who the babo is (they share the same basis data).
I can come up with a way of building an extra network based on the GraphView, but this seems like something somebody else has already needed so I figured I better ask first (obviously after having checked the mailing list archive ;) )
I'm not sure what you are talking about. GraphViews are not just for drawing, everything else should work with them. The fact that the histograms compare to True probably just mean that the in-degrees are not affected by the filter, or some other silly thing. If you still think there is a problem, please post a minimal and self-contained example (the one you sent isn't, because it did not contain the graph you used). Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
participants (2)
-
Dominguez Morán, Juan Manuel -
Tiago de Paula Peixoto