Skip to content

Commit

Permalink
poster plots
Browse files Browse the repository at this point in the history
  • Loading branch information
karacolada committed Jul 23, 2024
1 parent 759a8b1 commit f276597
Show file tree
Hide file tree
Showing 3 changed files with 412 additions and 4 deletions.
12 changes: 12 additions & 0 deletions src/analysis/plot_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

file="/home/kmoraw/SSI/rse-repo-analysis/data/derived/high_interest_repos.txt"
while read line; do
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/
done < "${file}"

file="/home/kmoraw/SSI/rse-repo-analysis/data/derived/one_person_repos.txt"
while read line; do
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/
done < "${file}"

9 changes: 5 additions & 4 deletions src/analysis/repository_timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import os
import seaborn as sns
from datetime import datetime, timezone, timedelta
import matplotlib
matplotlib.use("Agg")
from matplotlib import pyplot as plt

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

if __name__ == "__main__":
parser = argparse.ArgumentParser(
Expand Down
Loading

0 comments on commit f276597

Please sign in to comment.