Skip to content

Commit f276597

Browse files
committed
poster plots
1 parent 759a8b1 commit f276597

File tree

3 files changed

+412
-4
lines changed

3 files changed

+412
-4
lines changed

src/analysis/plot_all.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
file="/home/kmoraw/SSI/rse-repo-analysis/data/derived/high_interest_repos.txt"
4+
while read line; do
5+
python3 repository_timeline_anon_for_poster.py --repo "${line}" --outdir /home/kmoraw/SSI/rse-repo-analysis/data/derived/plots/repo_timelines/true_positives/many_users/
6+
done < "${file}"
7+
8+
file="/home/kmoraw/SSI/rse-repo-analysis/data/derived/one_person_repos.txt"
9+
while read line; do
10+
python3 repository_timeline_anon_for_poster.py --repo "${line}" --outdir /home/kmoraw/SSI/rse-repo-analysis/data/derived/plots/repo_timelines/true_positives/one_user/
11+
done < "${file}"
12+

src/analysis/repository_timeline.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import os
55
import seaborn as sns
66
from datetime import datetime, timezone, timedelta
7+
import matplotlib
8+
matplotlib.use("Agg")
79
from matplotlib import pyplot as plt
810

911
def info(verbose, msg):
@@ -346,10 +348,9 @@ def main(repo, githubdir, eprintsdir, output_dir, verbose):
346348
fig.suptitle(repo)
347349
s = repo.replace("/", "-")
348350
fig.tight_layout(rect=[0, 0.03, 1, 0.98])
349-
outpath = os.path.join(dir, output_dir)
350-
os.makedirs(outpath, exist_ok=True)
351-
plt.savefig(os.path.join(outpath, f"{s}.png"), bbox_inches="tight")
352-
info(verbose, f"Plot saved in {outpath}, file {s}.png.")
351+
os.makedirs(output_dir, exist_ok=True)
352+
plt.savefig(os.path.join(output_dir, f"{s}.png"), bbox_inches="tight")
353+
info(verbose, f"Plot saved in {output_dir}, file {s}.png.")
353354

354355
if __name__ == "__main__":
355356
parser = argparse.ArgumentParser(

0 commit comments

Comments
 (0)