Skip to content

Commit b1300b6

Browse files
committed
fix make_report to go faster
1 parent 4d9753b commit b1300b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/github_analysis/make_report.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def calc_conf(a):
102102

103103
class Report:
104104
def __init__(self, data_path='/Users/richiezitomer/Documents/RStudio-Data-Repository/clean_data/commits_by_org.feather',
105-
embedding_path='results/embeddings.csv', num_motifs_to_sample=1000, motif_lengths=[5,10,25,50,100]):
105+
embedding_path='results/embeddings.csv', num_motifs_to_sample=100, motif_lengths=[5,10,25,50,100]):
106106
self.emb = pd.read_csv(embedding_path)
107107
self.project_ids = self.emb.type.values
108108
self.proj_ids_string = ",".join(self.project_ids.astype(str))
@@ -154,7 +154,7 @@ def get_multi_chain_percent_by_proj(self, k,proj_id):
154154
nodes = [root] + [v for u, v in edges]
155155
# print(len(nodes))
156156

157-
for i in range(0, len(nodes), k):
157+
for i in range(0, min(len(nodes),200), k):
158158
current_root = nodes[i]
159159
current_edges = nx.bfs_edges(G, current_root) # https://networkx.github.io/documentation/networkx-2.2/reference/algorithms/generated/networkx.algorithms.traversal.breadth_first_search.bfs_edges.html#networkx.algorithms.traversal.breadth_first_search.bfs_edges
160160
current_nodes = [current_root] + [v for u, v in current_edges]

0 commit comments

Comments
 (0)