diging / tethne

Python module for bibliographic network analysis.
http://diging.github.io/tethne/
GNU General Public License v3.0
81 stars 32 forks source link

direct_citation creates undirected graph with no node attributes #137

Closed KHoover2009 closed 8 years ago

KHoover2009 commented 8 years ago

tethne.networks.papers.direct_citation no longer creates a directed citation network. instead it produces a undirected graph making intelligent interpretation difficult. Additionally somewhere between version .4 and .7 it lost the ability to create node attributes by passing a list argument.

help?

erickpeirson commented 8 years ago

Yikes, that's odd. Looking into it.

erickpeirson commented 8 years ago

@aosingh Can you take a look at this today?

aosingh commented 8 years ago

@erickpeirson ok, will pick this today.

aosingh commented 8 years ago

@erickpeirson, The method, as shown below, returns a Graph object. The class nx.Graph is the base class for undirected graphs.

return _generate_graph(nx.Graph, pairs, node_attrs=node_type, min_weight=min_weight)

We can modify it to return a DiGraph.

erickpeirson commented 8 years ago

Yes, we should change that to a DiGraph

https://asu.academia.edu/ErickPeirson Postdoctoral Researcher Arizona State University

On Fri, Mar 18, 2016 at 1:24 PM, Abhishek Omprakash Singh < notifications@github.com> wrote:

@erickpeirson https://github.com/erickpeirson, The method, as shown below, returns a Graph object. The class nx.Graph is the base class for undirected graphs.

return _generate_graph(nx.Graph, pairs, node_attrs=node_type, min_weight=min_weight)

We can modify it to return a DiGraph.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/diging/tethne/issues/137#issuecomment-198461928

aosingh commented 8 years ago

Fixed and tested it. Also changed the test case validation to self.assertIsInstance(g, nx.DiGraph). Please find below an execution trace for wos corpus.

wos_citation_graph = papers.direct_citation(wosCorpus)

type(wos_citation_graph) <class 'networkx.classes.digraph.DiGraph'>

erickpeirson commented 8 years ago

Awesome; can you raise a PR?

aosingh commented 8 years ago

PR raised.

erickpeirson commented 8 years ago

@KHoover2009 Can you confirm that this fixes the problem?

Be sure to install the latest version of tethne:

$ pip install -U tethne
KHoover2009 commented 8 years ago

Confirmed

Kevin Hoover kevin.hoover@ucdenver.edu


From: Erick notifications@github.com Sent: Wednesday, May 18, 2016 4:24:07 AM To: diging/tethne Cc: Hoover, Kevin; Mention Subject: Re: [diging/tethne] direct_citation creates undirected graph with no node attributes (#137)

@KHoover2009https://github.com/KHoover2009 Can you confirm that this fixes the problem?

Be sure to install the latest version of tethne:

$ pip install -U tethne

You are receiving this because you were mentioned. Reply to this email directly or view it on GitHubhttps://github.com/diging/tethne/issues/137#issuecomment-219986356

erickpeirson commented 8 years ago

Fantastic; thanks!


Erick Peirson Postdoctoral Scholar ASU-SFI Center for Biosocial Complexity Arizona State University

On May 18, 2016, at 5:41 PM, KHoover2009 notifications@github.com wrote:

Confirmed

Kevin Hoover kevin.hoover@ucdenver.edu


From: Erick notifications@github.com Sent: Wednesday, May 18, 2016 4:24:07 AM To: diging/tethne Cc: Hoover, Kevin; Mention Subject: Re: [diging/tethne] direct_citation creates undirected graph with no node attributes (#137)

@KHoover2009https://github.com/KHoover2009 Can you confirm that this fixes the problem?

Be sure to install the latest version of tethne:

$ pip install -U tethne

You are receiving this because you were mentioned. Reply to this email directly or view it on GitHubhttps://github.com/diging/tethne/issues/137#issuecomment-219986356 — You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub