Skip to content

Commit 141468b

Browse files
committed
corrected index pages
The alphabetical ordering of "Definition by Topic" and "Proof by Topic" has been corrected, avoiding problems with non-capital letters (such as "p") and non-letter characters (such as "(").
1 parent fcf71a3 commit 141468b

4 files changed

Lines changed: 25 additions & 28 deletions

File tree

I/DbT.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ title: "Definition by Topic"
151151

152152
### P
153153

154+
- [p-value](/D/pval)
154155
- [Point and set hypothesis](/D/hyp-point)
155156
- [Poisson distribution](/D/poiss)
156157
- [Poisson distribution with exposure values](/D/poissexp)
@@ -210,6 +211,7 @@ title: "Definition by Topic"
210211

211212
### T
212213

214+
- [t-distribution](/D/t)
213215
- [Test statistic](/D/tstat)
214216
- [Total sum of squares](/D/tss)
215217
- [Transformed general linear model](/D/tglm)
@@ -232,11 +234,3 @@ title: "Definition by Topic"
232234

233235
- [Wald distribution](/D/wald)
234236
- [Wishart distribution](/D/wish)
235-
236-
### p
237-
238-
- [p-value](/D/pval)
239-
240-
### t
241-
242-
- [t-distribution](/D/t)

I/PbT.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ title: "Proof by Topic"
44
---
55

66

7-
### (
8-
9-
- [(Non-)Multiplicativity of the expected value](/P/mean-mult)
10-
117
### A
128

139
- [Accuracy and complexity for the univariate Gaussian](/P/ug-anc)
@@ -194,6 +190,7 @@ title: "Proof by Topic"
194190
### N
195191

196192
- [Necessary and sufficient condition for independence of multivariate normal random variables](/P/mvn-ind)
193+
- [(Non-)Multiplicativity of the expected value](/P/mean-mult)
197194
- [Non-invariance of the differential entropy under change of variables](/P/dent-noninv)
198195
- [Non-negativity of the Kullback-Leibler divergence](/P/kl-nonneg)
199196
- [Non-negativity of the Kullback-Leibler divergence](/P/kl-nonneg2)

I/ToC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "Table of Contents"
55

66

77
**[Proofs](/P/-temp-)** are printed in **bold***[Definitions](/D/-temp-)* are set in *italics* <br>
8-
**Proofs**: [by Number](/I/Proof_by_Number), [by Topic](/I/Proof_by_Topic)*Definitions*: [by Number](/I/Definition_by_Number), [by Topic](/I/Definition_by_Topic) <br>
8+
**Proofs**: [by Number](/I/PbN), [by Topic](/I/PbT)*Definitions*: [by Number](/I/DbN), [by Topic](/I/DbT) <br>
99
<u>Specials:</u> [Probability Distributions](/S/Probability_Distributions), [Statistical Models](/S/Statistical_Models), [Model Selection Criteria](/S/Model_Selection) <br>
1010

1111

update.py

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
E-Mail: joram.soch@bccn-berlin.de
1818
1919
First edit: 2019-09-27 12:55:00
20-
Last edit: 2020-08-26 18:51:00
20+
Last edit: 2021-11-05 07:12:00
2121
"""
2222

2323

@@ -57,7 +57,9 @@
5757
if line.find('shortcut:') == 0:
5858
shortcut = re.sub('"', '', line[10:-1])
5959
if line.find('title:') == 0:
60-
title = re.sub('"', '', line[7:-1])
60+
title = re.sub('"', '', line[7:-1])
61+
title_edit = re.sub('[^a-zA-Z- ]', '', title)
62+
title_sort = title_edit[0].upper() + title_edit[1:]
6163
if line.find('author:') == 0:
6264
author = re.sub('"', '', line[8:-1])
6365
if line.find('username:') == 0:
@@ -78,7 +80,7 @@
7880
'username': username, 'date': date, 'source': source}
7981
pr_ids.append(proof_id)
8082
pr_nos.append(int(proof_id[1:]))
81-
pr_titles.append(title)
83+
pr_titles.append(title_sort)
8284
pr_users.append(username)
8385

8486
# List files in definition directory
@@ -110,7 +112,9 @@
110112
if line.find('shortcut:') == 0:
111113
shortcut = re.sub('"', '', line[10:-1])
112114
if line.find('title:') == 0:
113-
title = re.sub('"', '', line[7:-1])
115+
title = re.sub('"', '', line[7:-1])
116+
title_edit = re.sub('[^a-zA-Z- ]', '', title)
117+
title_sort = title_edit[0].upper() + title_edit[1:]
114118
if line.find('author:') == 0:
115119
author = re.sub('"', '', line[8:-1])
116120
if line.find('username:') == 0:
@@ -131,7 +135,7 @@
131135
'username': username, 'date': date, 'source': source}
132136
def_ids.append(def_id)
133137
def_nos.append(int(def_id[1:]))
134-
def_titles.append(title)
138+
def_titles.append(title_sort)
135139
def_users.append(username)
136140

137141
# Output number of proof files
@@ -221,13 +225,14 @@
221225
#-----------------------------------------------------------------------------#
222226
sort_ind = [i for (v, i) in sorted([(v, i) for (i, v) in enumerate(pr_titles)])]
223227
for i in range(0,len(pr_titles)):
224-
shortcut = proofs[pr_ids[sort_ind[i]]]['shortcut']
225-
title = proofs[pr_ids[sort_ind[i]]]['title']
228+
shortcut = proofs[pr_ids[sort_ind[i]]]['shortcut']
229+
title = proofs[pr_ids[sort_ind[i]]]['title']
230+
title_sort = pr_titles[sort_ind[i]]
226231
if i == 0:
227-
ind3a.write('### ' + title[0] + '\n\n')
232+
ind3a.write('### ' + title_sort[0] + '\n\n')
228233
else:
229-
if title[0] != proofs[pr_ids[sort_ind[i-1]]]['title'][0]:
230-
ind3a.write('\n### ' + title[0] + '\n\n')
234+
if title_sort[0] != pr_titles[sort_ind[i-1]][0]:
235+
ind3a.write('\n### ' + title_sort[0] + '\n\n')
231236
ind3a.write('- [' + title + '](/P/' + shortcut + ')\n')
232237
ind3a.close()
233238
print(' - successfully written to disk!')
@@ -243,13 +248,14 @@
243248
#-----------------------------------------------------------------------------#
244249
sort_ind = [i for (v, i) in sorted([(v, i) for (i, v) in enumerate(def_titles)])]
245250
for i in range(0,len(def_titles)):
246-
shortcut = definitions[def_ids[sort_ind[i]]]['shortcut']
247-
title = definitions[def_ids[sort_ind[i]]]['title']
251+
shortcut = definitions[def_ids[sort_ind[i]]]['shortcut']
252+
title = definitions[def_ids[sort_ind[i]]]['title']
253+
title_sort = def_titles[sort_ind[i]]
248254
if i == 0:
249-
ind3b.write('### ' + title[0] + '\n\n')
255+
ind3b.write('### ' + title_sort[0] + '\n\n')
250256
else:
251-
if title[0] != definitions[def_ids[sort_ind[i-1]]]['title'][0]:
252-
ind3b.write('\n### ' + title[0] + '\n\n')
257+
if title_sort[0] != def_titles[sort_ind[i-1]][0]:
258+
ind3b.write('\n### ' + title_sort[0] + '\n\n')
253259
ind3b.write('- [' + title + '](/D/' + shortcut + ')\n')
254260
ind3b.close()
255261
print(' - successfully written to disk!')

0 commit comments

Comments
 (0)