Esempio n. 1
0
def lattice_render_webpage():
    info = to_dict(request.args, search_array=LatSearchArray())
    if not request.args:
        maxs=lattice_summary_data()
        dim_list = list(range(1, 11, 1))
        max_class_number = 20
        class_number_list = list(range(1, max_class_number + 1, 1))
        det_list_endpoints = [1, 5000, 10000, 20000, 25000, 30000]
        det_list = ["%s-%s" % (start, end - 1) for start, end in zip(det_list_endpoints[:-1], det_list_endpoints[1:])]
        name_list = ["A2","Z2", "D3", "D3*", "3.1942.3884.56.1", "A5", "E8", "A14", "Leech"]
        info.update({'dim_list': dim_list,'class_number_list': class_number_list,'det_list': det_list, 'name_list': name_list})
        credit = lattice_credit
        t = 'Integral Lattices'
        bread = [('Lattice', url_for(".lattice_render_webpage"))]
        info['summary'] = lattice_summary()
        info['max_cn']=maxs[0]
        info['max_dim']=maxs[1]
        info['max_det']=maxs[2]
        return render_template("lattice-index.html", info=info, credit=credit, title=t, learnmore=learnmore_list(), bread=bread)
    else:
        return lattice_search(info)
Esempio n. 2
0
def lattice_render_webpage():
    args = request.args
    if len(args) == 0:
        maxs=lattice_summary_data()
        dim_list= range(1, 11, 1)
        max_class_number=20
        class_number_list=range(1, max_class_number+1, 1)
        det_list_endpoints = [1, 5000, 10000, 20000, 25000, 30000]
        det_list = ["%s-%s" % (start, end - 1) for start, end in zip(det_list_endpoints[:-1], det_list_endpoints[1:])]
        name_list = ["A2","Z2", "D3", "D3*", "3.1942.3884.56.1", "A5", "E8", "A14", "Leech"]
        info = {'dim_list': dim_list,'class_number_list': class_number_list,'det_list': det_list, 'name_list': name_list}
        credit = lattice_credit
        t = 'Integral Lattices'
        bread = [('Lattice', url_for(".lattice_render_webpage"))]
        info['summary'] = lattice_summary()
        info['max_cn']=maxs[0]
        info['max_dim']=maxs[1]
        info['max_det']=maxs[2]
        return render_template("lattice-index.html", info=info, credit=credit, title=t, learnmore=learnmore_list(), bread=bread)
    else:
        return lattice_search(**args)