Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
AndrewVSutherland
GitHub Repository: AndrewVSutherland/lmfdb
Path: blob/main/scripts/groups/Make-images/dump-group-names.py
1136 views
1
import sys, os
2
from collections import defaultdict
3
HOME=os.path.expanduser("~")
4
sys.path.append(os.path.join(HOME, 'lmfdb'))
5
from lmfdb import db
6
7
myhash = defaultdict(list)
8
9
for g in db.gps_groups.search({}, ['tex_name', 'label']):
10
myhash[g['tex_name']].append(g['label'])
11
12
for g in db.gps_subgroup_search.search({}, ['quotient_tex', 'subgroup_tex', 'label']):
13
if g['quotient_tex']:
14
myhash[g['quotient_tex']].append(g['label'])
15
if g['subgroup_tex']:
16
myhash[g['subgroup_tex']].append(g['label'])
17
18
count = 1
19
with open("eqguts.tex", "w") as eqguts:
20
with open("prettyindex", "w") as prettyindex:
21
prettyindex.write('[1,"?"]\n')
22
eqguts.write(r'$?$'+'\n')
23
for p in myhash.keys():
24
pp = p.replace('\\', '\\\\')
25
eqguts.write('$'+str(p)+'$\n')
26
count += 1
27
prettyindex.write('[%d, "%s"]\n'%(count, pp))
28
29
print ("Max count is %d" % count)
30
31