Path: blob/main/scripts/groups/Make-images/dump-group-names.py
1136 views
import sys, os1from collections import defaultdict2HOME=os.path.expanduser("~")3sys.path.append(os.path.join(HOME, 'lmfdb'))4from lmfdb import db56myhash = defaultdict(list)78for g in db.gps_groups.search({}, ['tex_name', 'label']):9myhash[g['tex_name']].append(g['label'])1011for g in db.gps_subgroup_search.search({}, ['quotient_tex', 'subgroup_tex', 'label']):12if g['quotient_tex']:13myhash[g['quotient_tex']].append(g['label'])14if g['subgroup_tex']:15myhash[g['subgroup_tex']].append(g['label'])1617count = 118with open("eqguts.tex", "w") as eqguts:19with open("prettyindex", "w") as prettyindex:20prettyindex.write('[1,"?"]\n')21eqguts.write(r'$?$'+'\n')22for p in myhash.keys():23pp = p.replace('\\', '\\\\')24eqguts.write('$'+str(p)+'$\n')25count += 126prettyindex.write('[%d, "%s"]\n'%(count, pp))2728print ("Max count is %d" % count)293031