Skip to content

Commit e1de902

Browse files
committed
MNT: Add .zenodo.json, tool to sort by commits
1 parent 246d9f9 commit e1de902

File tree

3 files changed

+316
-6
lines changed

3 files changed

+316
-6
lines changed

.mailmap

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
# gives no duplicates.
1010
Michael Hanke <[email protected]> <mhanke-guest@82381867-18eb-0310-98a2-9474e637aba2>
1111
12-
Yaroslav Halchenko <[email protected]> <yoh-guest@82381867-18eb-0310-98a2-9474e637aba2>
12+
Yaroslav O. Halchenko <[email protected]> <yoh-guest@82381867-18eb-0310-98a2-9474e637aba2>
13+
Yaroslav O. Halchenko <[email protected]> Yaroslav Halchenko <[email protected]>
1314
Bertrand Thirion <[email protected]> bthirion <[email protected]>
1415
Stephan Gerhard <[email protected]> Stephan Gerhard <[email protected]>
1516
Christian Haselgrove <[email protected]> Christian Haselgrove <[email protected]>
@@ -28,11 +29,11 @@ Basile Pinsard <[email protected]> bpinsard <[email protected]>
2829
Basile Pinsard <[email protected]> bpinsard <[email protected]>
2930
3031
Ben Cipollini <[email protected]> Ben Cipollini <[email protected]>
31-
Chris Markiewicz <[email protected]> Christopher J. Markiewicz <[email protected]>
32-
Chris Markiewicz <[email protected]> Chris Markiewicz <[email protected]>
33-
Chris Markiewicz <[email protected]> Christopher J. Markiewicz <[email protected]>
34-
Chris Markiewicz <[email protected]> Christopher J. Markiewicz <[email protected]>
35-
Chris Markiewicz <[email protected]> Chris Johnson <[email protected]>
32+
Christopher J. Markiewicz <[email protected]> Chris Markiewicz <[email protected]>
33+
Christopher J. Markiewicz <[email protected]> Chris Markiewicz <[email protected]>
34+
Christopher J. Markiewicz <[email protected]> Christopher J. Markiewicz <[email protected]>
35+
Christopher J. Markiewicz <[email protected]> Christopher J. Markiewicz <[email protected]>
36+
Christopher J. Markiewicz <[email protected]> Chris Johnson <[email protected]>
3637
Jaakko Leppäkangas <[email protected]> jaeilepp <[email protected]>
3738
Ariel Rokem <[email protected]> arokem <[email protected]>
3839
Oliver P. Hinds <[email protected]> ohinds <[email protected]>
@@ -42,3 +43,12 @@ Jasper J.F. van den Bosch <[email protected]> Jasper <[email protected]>
4243
Gregory R. Lee <[email protected]> Gregory R. Lee <[email protected]>
4344
Demian Wassermann <[email protected]> Demian Wassermann <[email protected]>
4445
Paul McCarthy <[email protected]> Paul McCarthy <[email protected]>
46+
B. Nolan Nichols <[email protected]> Nolan Nichols <[email protected]>
47+
Mathias Goncalves <[email protected]> mathiasg <[email protected]>
48+
Serge Koudoro <[email protected]> skoudoro <[email protected]>
49+
Kesshi Jordan <[email protected]> kesshijordan <[email protected]>
50+
Fernando Pérez-García <[email protected]> Fernando <[email protected]>
51+
Dimitri Papadopoulos Orfanos <[email protected]> Dimitri Papadopoulos <[email protected]>
52+
Thomas Roos <[email protected]> Roosted7 <[email protected]>
53+
Venky Reddy <[email protected]> R3DDY97 <[email protected]>
54+
Jon Haitz Legarreta <[email protected]> Jon Haitz Legarreta Gorroño <[email protected]>

.zenodo.json

Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,255 @@
1+
{
2+
"creators": [
3+
{
4+
"name": "Brett, Matthew"
5+
},
6+
{
7+
"affiliation": "Stanford University",
8+
"name": "Markiewicz, Christopher J.",
9+
"orcid": "0000-0002-6533-164X"
10+
},
11+
{
12+
"affiliation": "Otto-von-Guericke-University Magdeburg, Germany",
13+
"name": "Hanke, Michael",
14+
"orcid": "0000-0001-6398-6370"
15+
},
16+
{
17+
"name": "C\u00f4t\u00e9, Marc-Alexandre"
18+
},
19+
{
20+
"affiliation": "UC San Diego",
21+
"name": "Cipollini, Ben",
22+
"orcid": "0000-0002-7782-0790"
23+
},
24+
{
25+
"name": "McCarthy, Paul"
26+
},
27+
{
28+
"name": "Cheng, Christopher P."
29+
},
30+
{
31+
"affiliation": "Dartmouth College: Hanover, NH, United States",
32+
"name": "Halchenko, Yaroslav O.",
33+
"orcid": "0000-0003-3456-2493"
34+
},
35+
{
36+
"affiliation": "MIT, HMS",
37+
"name": "Ghosh, Satrajit",
38+
"orcid": "0000-0002-5312-6729"
39+
},
40+
{
41+
"affiliation": "Athena EPI, Inria Sophia-Antipolis",
42+
"name": "Wassermann, Demian",
43+
"orcid": "0000-0001-5194-6056"
44+
},
45+
{
46+
"name": "Larson, Eric"
47+
},
48+
{
49+
"affiliation": "Institute of Neuroinformatics, ETH/University of Zurich",
50+
"name": "Gerhard, Stephan",
51+
"orcid": "0000-0003-4454-6171"
52+
},
53+
{
54+
"name": "Lee, Gregory R."
55+
},
56+
{
57+
"affiliation": "Harvard University - Psychology",
58+
"name": "Kastman, Erik",
59+
"orcid": "0000-0001-7221-9042"
60+
},
61+
{
62+
"affiliation": "The University of Washington eScience Institute",
63+
"name": "Rokem, Ariel",
64+
"orcid": "0000-0003-0679-1985"
65+
},
66+
{
67+
"name": "Madison, Cindee"
68+
},
69+
{
70+
"name": "Morency, F\u00e9lix C."
71+
},
72+
{
73+
"name": "Moloney, Brendan"
74+
},
75+
{
76+
"name": "Cottaar, Michiel"
77+
},
78+
{
79+
"name": "Burns, Christopher"
80+
},
81+
{
82+
"name": "Millman, Jarrod"
83+
},
84+
{
85+
"affiliation": "CNRS LTCI, Telecom ParisTech, Universit\u00e9 Paris-Saclay",
86+
"name": "Gramfort, Alexandre",
87+
"orcid": "0000-0001-9791-4404"
88+
},
89+
{
90+
"name": "Lepp\u00e4kangas, Jaakko"
91+
},
92+
{
93+
"affiliation": "Montreal Neurological Institute and Hospital",
94+
"name": "Markello, Ross",
95+
"orcid": "0000-0003-1057-1336"
96+
},
97+
{
98+
"name": "van den Bosch, Jasper J.F."
99+
},
100+
{
101+
"name": "Vincent, Robert D."
102+
},
103+
{
104+
"name": "Subramaniam, Krish"
105+
},
106+
{
107+
"name": "Raamana, Pradeep Reddy"
108+
},
109+
{
110+
"affiliation": "SRI International",
111+
"name": "Nichols, B. Nolan",
112+
"orcid": "0000-0003-1099-3328"
113+
},
114+
{
115+
"name": "Baker, Eric M."
116+
},
117+
{
118+
"affiliation": "MIT",
119+
"name": "Goncalves, Mathias",
120+
"orcid": "0000-0002-7252-7771"
121+
},
122+
{
123+
"name": "Hayashi, Soichi"
124+
},
125+
{
126+
"name": "Pinsard, Basile"
127+
},
128+
{
129+
"name": "Haselgrove, Christian"
130+
},
131+
{
132+
"name": "Hymers, Mark"
133+
},
134+
{
135+
"name": "Koudoro, Serge"
136+
},
137+
{
138+
"name": "Oosterhof, Nikolaas N."
139+
},
140+
{
141+
"name": "Amirbekian, Bago"
142+
},
143+
{
144+
"name": "Nimmo-Smith, Ian"
145+
},
146+
{
147+
"name": "Nguyen, Ly"
148+
},
149+
{
150+
"name": "St-Jean, Samuel"
151+
},
152+
{
153+
"name": "Garyfallidis, Eleftherios"
154+
},
155+
{
156+
"affiliation": "INRIA",
157+
"name": "Varoquaux, Gael",
158+
"orcid": "0000-0003-1076-5122"
159+
},
160+
{
161+
"affiliation": "MIT",
162+
"name": "Kaczmarzyk, Jakub",
163+
"orcid": "0000-0002-5544-7577"
164+
},
165+
{
166+
"name": "Hahn, Kevin S."
167+
},
168+
{
169+
"name": "Hinds, Oliver P."
170+
},
171+
{
172+
"name": "Fauber, Bennet"
173+
},
174+
{
175+
"affiliation": "McGill University",
176+
"name": "Poline, Jean-Baptiste",
177+
"orcid": "0000-0002-9794-749X"
178+
},
179+
{
180+
"name": "Stutters, Jon"
181+
},
182+
{
183+
"affiliation": "University of California, San Francisco",
184+
"name": "Jordan, Kesshi",
185+
"orcid": "0000-0001-6313-0580"
186+
},
187+
{
188+
"name": "Moreno, Miguel Estevan"
189+
},
190+
{
191+
"name": "Haenel, Valentin"
192+
},
193+
{
194+
"name": "Schwartz, Yannick"
195+
},
196+
{
197+
"affiliation": "INRIA",
198+
"name": "Thirion, Bertrand",
199+
"orcid": "0000-0001-5018-7895"
200+
},
201+
{
202+
"affiliation": "CEA",
203+
"name": "Papadopoulos Orfanos, Dimitri",
204+
"orcid": "0000-0002-1242-8990"
205+
},
206+
{
207+
"affiliation": "University College London",
208+
"name": "P\u00e9rez-Garc\u00eda, Fernando",
209+
"orcid": "0000-0001-9090-3024"
210+
},
211+
{
212+
"name": "Solovey, Igor"
213+
},
214+
{
215+
"name": "Gonzalez, Ivan"
216+
},
217+
{
218+
"name": "Legarreta, Jon Haitz"
219+
},
220+
{
221+
"name": "Lecher, Justin"
222+
},
223+
{
224+
"affiliation": "TIB \u2013 Leibniz Information Centre for Science and Technology and University Library, Hannover, Germany",
225+
"name": "Leinweber, Katrin",
226+
"orcid": "0000-0001-5135-5758"
227+
},
228+
{
229+
"name": "Fischer, Peter"
230+
},
231+
{
232+
"name": "Gervais, Philippe"
233+
},
234+
{
235+
"name": "Gadde, Syam"
236+
},
237+
{
238+
"name": "Ballinger, Thomas"
239+
},
240+
{
241+
"name": "Roos, Thomas"
242+
},
243+
{
244+
"name": "Venky Reddy"
245+
},
246+
{
247+
"name": "freec84"
248+
}
249+
],
250+
"keywords": [
251+
"neuroimaging"
252+
],
253+
"license": "mit-license",
254+
"upload_type": "software"
255+
}

tools/prep_zenodo.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env python3
2+
import git
3+
import json
4+
from subprocess import run, PIPE
5+
from pathlib import Path
6+
7+
skip = {'nibotmi'}
8+
9+
10+
def decommify(name):
11+
return ' '.join(name.split(', ')[::-1])
12+
13+
14+
git_root = Path(git.Repo('.', search_parent_directories=True).working_dir)
15+
zenodo_file = git_root / '.zenodo.json'
16+
17+
zenodo = json.loads(zenodo_file.read_text()) if zenodo_file.exists() else {}
18+
19+
orig_creators = zenodo.get('creators', [])
20+
creator_map = {decommify(creator['name']): creator
21+
for creator in orig_creators}
22+
23+
shortlog = run(['git', 'shortlog', '-ns'], stdout=PIPE)
24+
counts = [line.split('\t', 1)[::-1]
25+
for line in shortlog.stdout.decode().split('\n') if line]
26+
27+
commit_counts = {}
28+
for committer, commits in counts:
29+
commit_counts[committer] = commit_counts.get(committer, 0) + int(commits)
30+
31+
# Stable sort:
32+
# Number of commits in reverse order
33+
# Ties broken by alphabetical order of first name
34+
committers = [committer
35+
for committer, _ in sorted(commit_counts.items(),
36+
key=lambda x: (-x[1], x[0]))]
37+
38+
creators = [
39+
creator_map.get(committer, {'name': committer})
40+
for committer in committers
41+
if committer not in skip
42+
]
43+
44+
zenodo['creators'] = creators
45+
zenodo_file.write_text(json.dumps(zenodo, indent=2, sort_keys=True) + '\n')

0 commit comments

Comments
 (0)