$ cd the_git_folder_you_want
$ git log --format='%ae' | sort -u | tee base_author.txt
$ bash generate_edge_list.sh | tee base_edge_list.txt
Last active
August 29, 2015 14:07
-
-
Save sangheestyle/194df031ab2df3580871 to your computer and use it in GitHub Desktop.
Make biparted graph and projection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
authors=(`git log --format='%ae' | sort -u`) | |
for author in ${author[*]} | |
do | |
files=(`git log --no-merges --stat --author="$author" --name-only --pretty=format:"" | sort -u`) | |
for file in ${files[*]} | |
do | |
echo $author $file | |
done | |
done |
Author
sangheestyle
commented
Oct 12, 2014
import networkx as nx
g = nx.read_edgelist("base_edge_list.txt")
with open('base_authors.txt') as f:
authors = f.read().splitlines()
authors = [a for a in authors if a in g.nodes()]
g_projected = nx.algorithms.bipartite.projected_graph(g, authors)
nx.write_graphml(g_projected, "base.graphml")
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment