def artin_postprocess(res, info, query): gp_labels = list( set([rec["GaloisLabel"] for rec in res] + [rec["Container"].upper() for rec in res] + ["T".join(str(c) for c in rec["Proj_nTj"]) for rec in res])) cache = knowl_cache(gp_labels) return [ArtinRepresentation(data=x, knowl_cache=cache) for x in res]
def nf_postprocess(res, info, query): galois_labels = [rec["galois_label"] for rec in res if rec.get("galois_label")] cache = knowl_cache(list(set(galois_labels))) for rec in res: wnf = WebNumberField.from_data(rec) rec["poly"] = wnf.web_poly() rec["disc"] = wnf.disc_factored_latex() rec["galois"] = wnf.galois_string(cache=cache) rec["class_group_desc"] = wnf.class_group_invariants() return res
def galcache(): return knowl_cache(db.lf_fields.distinct("galois_label"))
def contcache(): return knowl_cache([label for label in db.artin_reps.distinct("Container") if "T" in label])
def projcache(): return knowl_cache(["%sT%s" % tuple(label) for label in db.artin_reps.distinct("Proj_nTj")])
def galcache(): return knowl_cache(db.artin_reps.distinct("GaloisLabel"))
def lf_postprocess(res, info, query): cache = knowl_cache(list(set([f"{rec['n']}T{rec['gal']}" for rec in res]))) for rec in res: rec["cache"] = cache return res