sorting of developer names
This commit is contained in:
@ -7,9 +7,8 @@ Sorts the entries in the contents files of each sub folder alphabetically.
|
||||
"""
|
||||
|
||||
# TODO check for within an entry for similar dev names
|
||||
# TODO special mode (load all and safe all)
|
||||
# TODO sort devs alphabetically upon save (if not done yet)
|
||||
# TODO statistics on git repositories (created, stars, forks) and meaningful categories
|
||||
# TODO wikipedia (media search)
|
||||
# TODO google search (for homepages or media entries) for popular ones at least
|
||||
|
||||
import os
|
||||
import re
|
||||
@ -864,13 +863,46 @@ class EntriesMaintainer:
|
||||
print('entries not yet loaded')
|
||||
return
|
||||
|
||||
# cvs without any git
|
||||
# collect statistics on git repositories
|
||||
created = {}
|
||||
stars = []
|
||||
forks = []
|
||||
for entry in self.entries:
|
||||
repos = entry['Code repository']
|
||||
cvs = [repo for repo in repos if 'cvs' in repo]
|
||||
git = [repo for repo in repos if 'git' in repo]
|
||||
if len(cvs) > 0 and len(git) == 0:
|
||||
print('Entry "{}" with repos: {}'.format(entry['File'], repos))
|
||||
comments = [x.comment for x in repos if x.value.startswith('https://github.com/') and x.comment]
|
||||
for comment in comments:
|
||||
comment = comment.split(',')
|
||||
comment = [c.strip() for c in comment]
|
||||
comment = [c for c in comment if c.startswith('@')]
|
||||
if comment:
|
||||
try:
|
||||
comment = [c.split(' ') for c in comment]
|
||||
comment = [c[1] for c in comment if len(c) > 1]
|
||||
except Exception:
|
||||
print(comment)
|
||||
raise
|
||||
created[comment[0]] = created.get(comment[0], 0) + 1
|
||||
stars.append(comment[1])
|
||||
forks.append(comment[2])
|
||||
|
||||
for key, value in sorted(created.items(), key=lambda x: x[0]):
|
||||
print("{} : {}".format(key, value))
|
||||
|
||||
import numpy as np
|
||||
np.set_printoptions(suppress=True)
|
||||
stars = np.array(stars, dtype=np.float)
|
||||
forks = np.array(forks, dtype=np.float)
|
||||
q = np.arange(0, 1, 0.1)
|
||||
print(np.quantile(stars, q))
|
||||
print(np.quantile(forks, q))
|
||||
|
||||
# # cvs without any git
|
||||
# for entry in self.entries:
|
||||
# repos = entry['Code repository']
|
||||
# cvs = [repo for repo in repos if 'cvs' in repo]
|
||||
# git = [repo for repo in repos if 'git' in repo]
|
||||
# if len(cvs) > 0 and len(git) == 0:
|
||||
# print('Entry "{}" with repos: {}'.format(entry['File'], repos))
|
||||
|
||||
# # combine content keywords
|
||||
# n = len('content ')
|
||||
|
Reference in New Issue
Block a user