Skip to content

Commit

Permalink
fix patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
karacolada committed Jul 10, 2024
1 parent a81f2d7 commit 3234b46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/analysis/aggregate_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def clean(headings_list):
cleaned_headings_list = []
for h in l:
h = h.lstrip(to_remove)
pattern = "\[(.+?)\]\(.+?\)"
# remove markdown-style links
pattern = r"\[(.+?)\]\(.+?\)"
h = re.sub(pattern, r'\1', h, count=0)
h = h.replace(string.punctuation, "")
h = h.strip(string.punctuation)
Expand Down
6 changes: 3 additions & 3 deletions src/analysis/overall.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def clean_heading(h):
to_remove = string.digits + string.whitespace + ".:"
h = h.lstrip(to_remove)
# remove markdown-style links
pattern = "\[(.+?)\]\(.+?\)"
pattern = r"\[(.+?)\]\(.+?\)"
h = re.sub(pattern, r'\1', h, count=0)
# remove any punctuation and convert to lower-case
h = h.replace(string.punctuation, "")
Expand Down Expand Up @@ -243,10 +243,10 @@ def main(data_dir, outdir, verbose, filter_path, tag):
plot_table(metadata, stars, forks, ax7)
if tag:
plt.suptitle(f"Overall statistics for ePrints repositories ({tag})")
plt.savefig(os.path.join(outdir, "overall", f"overall_{tag}.png"), bbox_inches="tight")
plt.savefig(os.path.join(outdir, "plots", "overall", f"overall_{tag}.png"), bbox_inches="tight")
else:
plt.suptitle("Overall statistics for ePrints repositories")
plt.savefig(os.path.join(outdir, "overall", "overall.png"), bbox_inches="tight")
plt.savefig(os.path.join(outdir, "plots", "overall", "overall.png"), bbox_inches="tight")

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

0 comments on commit 3234b46

Please sign in to comment.