-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug commit analysis #8
base: main
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import pandas as pd | ||
import matplotlib.pyplot as plt | ||
import seaborn as sns | ||
import fire | ||
|
||
def generate_charts(df_path, bug_chart_path, commit_chart_path): | ||
df = pd.read_csv(df_path) | ||
top_20_by_bug_count = df.nlargest(20, 'BugCount') | ||
top_20_by_commit_count = df.nlargest(20, 'CommitCount') | ||
|
||
plt.figure(figsize=(10, 8)) | ||
sns.barplot(x='BugCount', y='RepoName', data=top_20_by_bug_count, palette='viridis') | ||
plt.title('Top 20 Repositories by Bug Count') | ||
plt.xlabel('Bug Count') | ||
plt.ylabel('Repository') | ||
plt.tight_layout() | ||
plt.savefig(bug_chart_path) | ||
|
||
plt.figure(figsize=(10, 8)) | ||
sns.barplot(x='CommitCount', y='RepoName', data=top_20_by_commit_count, palette='viridis') | ||
plt.title('Top 20 Repositories by Commit Count') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't put titles on plots, it is the job of the caption |
||
plt.xlabel('Commit Count') | ||
plt.ylabel('Repository') | ||
plt.tight_layout() | ||
plt.savefig(commit_chart_path) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please save to PDF format as they are vector graphic files |
||
|
||
if __name__ == '__main__': | ||
fire.Fire(generate_charts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you make histograms of all instead of only top 20?