File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -107,13 +107,13 @@ x = bedges[:-1] + np.timedelta64(15, "D")
107107# NOTE: np.histogram doesn't work on datetimes
108108merged_prs_per_month = dict()
109109for proj, data in project_prs.items():
110- merged_prs = data["merged_prs"]
110+ # Num merged PRs per month
111+ merged_prs = np.array(data["merged_prs"], dtype=object)
111112 merge_dates = np.array([pr["mergedAt"] for pr in merged_prs], dtype="M8[D]")
112113 num_merged_per_month = []
113114 for lo, hi in itertools.pairwise(bedges):
114- num_merged_per_month.append(
115- sum(1 for md in merge_dates if md > lo and md < hi)
116- )
115+ month_mask = (merge_dates < hi) & (merge_dates > lo)
116+ num_merged_per_month.append(month_mask.sum())
117117 merged_prs_per_month[proj] = num_merged_per_month
118118```
119119
You can’t perform that action at this time.
0 commit comments