def _get_trend(cls, log, starting_date):
"""Get commit count trend based on log.
:param log: a log on which the trend should be computed
:param starting_date: starting date of log
:return: computed trend
"""
records = [0]
date = starting_date
for entry in log:
if entry['author']['date'] > date + cls._SECONDS_PER_DAY:
date += cls._SECONDS_PER_DAY
records.append(0)
records[-1] += 1
lr = LinearRegression()
lr.fit(np.array(range(len(records))).reshape(-1, 1), np.array(records))
return lr.coef_[0]
git_stats.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录