Skip to content

Commit 4735b71

Browse files
committed
Remove unnecessary __main__s.
1 parent ad2e871 commit 4735b71

8 files changed

+0
-91
lines changed

analytics/lib/citation_growth_histogram.py

-13
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,3 @@ def run(input_path, plot_density):
130130
os.remove(image_file)
131131
plt.savefig(image_file, bbox_inches='tight')
132132
plt.close()
133-
134-
135-
if __name__ == "__main__":
136-
if len(sys.argv) < 2:
137-
print("Missing input path.")
138-
exit()
139-
140-
plot_density = False
141-
if len(sys.argv) >= 3:
142-
plot_density = sys.argv[2] == "True"
143-
144-
run(sys.argv[1], plot_density)
145-

analytics/lib/cluster.py

-18
Original file line numberDiff line numberDiff line change
@@ -250,21 +250,3 @@ def run(input_path, cluster_count, cluster_source="citations"):
250250
for k in clusters.groups:
251251
avg_pre, avg_post = get_avg_pre_post(clusters.get_group(k))
252252
f.write(f"{get_repo_name(fName)}\t{k}\t{avg_pre}\t{avg_post}\n")
253-
254-
255-
if __name__ == "__main__":
256-
if len(sys.argv) < 2:
257-
print("Missing input path.")
258-
exit()
259-
260-
if len(sys.argv) >= 3:
261-
cluster_count = int(sys.argv[2])
262-
else:
263-
cluster_count = None
264-
265-
if len(sys.argv) >= 4:
266-
cluster_source = sys.argv[3]
267-
else:
268-
cluster_source = "citations"
269-
270-
run(sys.argv[1], cluster_count, cluster_source)

analytics/lib/plot_citations_distribution.py

-12
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,3 @@ def run(input_path, plot_density):
9393
os.remove(image_file)
9494
plt.savefig(image_file, bbox_inches='tight')
9595
plt.close()
96-
97-
98-
if __name__ == "__main__":
99-
if len(sys.argv) != 2:
100-
print("Missing input path.")
101-
exit()
102-
103-
plot_density = False
104-
if len(sys.argv) >= 3:
105-
plot_density = sys.argv[2] == "True"
106-
107-
run(sys.argv[1], plot_density)

analytics/lib/plot_cluster_quartiles.py

-12
Original file line numberDiff line numberDiff line change
@@ -327,15 +327,3 @@ def run(input_path, plot_changes):
327327
os.remove(image_file)
328328
plt.savefig(image_file, bbox_inches='tight')
329329
plt.close()
330-
331-
332-
if __name__ == "__main__":
333-
if len(sys.argv) < 2:
334-
print("Missing input path.")
335-
exit()
336-
337-
plot_changes = False
338-
if len(sys.argv) >= 3:
339-
plot_changes = sys.argv[2] == "True"
340-
341-
run(sys.argv[1], plot_changes)

analytics/lib/plot_gain_scores.py

-12
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,3 @@ def run(input_path, plot_density):
227227
os.remove(image_file)
228228
plt.savefig(image_file, bbox_inches='tight')
229229
plt.close()
230-
231-
232-
if __name__ == "__main__":
233-
if len(sys.argv) < 2:
234-
print("Missing input path.")
235-
exit()
236-
237-
plot_density = False
238-
if len(sys.argv) == 3:
239-
plot_density = sys.argv[2] == "True"
240-
241-
run(sys.argv[1], plot_density)

analytics/lib/plot_pubs_in_clusters.py

-8
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,3 @@ def autolabel(ax, rects):
109109
xytext=(0, 3), # 3 points vertical offset
110110
textcoords="offset points",
111111
ha='center', va='bottom')
112-
113-
114-
if __name__ == "__main__":
115-
if len(sys.argv) < 2:
116-
print("Missing input path.")
117-
exit()
118-
119-
run(sys.argv[1])

analytics/lib/plot_tool_pub.py

-8
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,3 @@ def run(input_path):
261261
filenames, repositories = get_clustered_repositories(input_path)
262262
plot(input_path, filenames, repositories)
263263
plot_clustered(input_path, filenames, repositories)
264-
265-
266-
if __name__ == "__main__":
267-
if len(sys.argv) < 2:
268-
print("Missing input path.")
269-
exit()
270-
271-
run(sys.argv[1])

analytics/lib/t_test_clustered_data.py

-8
Original file line numberDiff line numberDiff line change
@@ -463,11 +463,3 @@ def run(input_path):
463463
for i in range(0, len(filenames)-1):
464464
for j in range(i+1, len(filenames)):
465465
ttest_corresponding_clusters(root, filenames[i], filenames[j], tcc_filename)
466-
467-
468-
if __name__ == "__main__":
469-
if len(sys.argv) != 2:
470-
print("Missing input path.")
471-
exit()
472-
473-
run(sys.argv[1])

0 commit comments

Comments
 (0)