Esempio n. 1
0
def render_curve_webpage_by_label(label):
    #credit = 'John Cremona and Andrew Sutherland'
    data = WebEC.by_label(label)
    if data == "Invalid label":
        return elliptic_curve_jump_error(label, {}, wellformed_label=False)
    if data == "Curve not found":
        return elliptic_curve_jump_error(label, {}, wellformed_label=True)
    try:
        lmfdb_label = data.lmfdb_label
    except AttributeError:
        return elliptic_curve_jump_error(label, {}, wellformed_label=False)

    # if data.twoadic_label:
    #     credit = credit.replace(' and',',') + ' and Jeremy Rouse'
    # if data.data['iwdata']:
    #     credit = credit.replace(' and',',') + ' and Robert Pollack'
    data.modform_display = url_for(".modular_form_display", label=lmfdb_label, number="")

    code = data.code()
    code['show'] = {'magma':'','pari':'','sage':''} # use default show names
    return render_template("ec-curve.html",
                           properties2=data.properties,
                           credit=ec_credit(),
                           data=data,
                           # set default show names but actually code snippets are filled in only when needed
                           code=code,
                           bread=data.bread, title=data.title,
                           friends=data.friends,
                           downloads=data.downloads,
                           learnmore=learnmore_list())
Esempio n. 2
0
def render_curve_webpage_by_label(label):
    credit = 'John Cremona and Andrew Sutherland'
    data = WebEC.by_label(label)
    if data == "Invalid label":
        return elliptic_curve_jump_error(label, {}, wellformed_label=False)
    if data == "Curve not found":
        return elliptic_curve_jump_error(label, {}, wellformed_label=True)
    try:
        lmfdb_label = data.lmfdb_label
    except AttributeError:
        return elliptic_curve_jump_error(label, {}, wellformed_label=False)

    if data.twoadic_label:
        credit = credit.replace(' and', ',') + ' and Jeremy Rouse'
    data.modform_display = url_for(".modular_form_display",
                                   label=lmfdb_label,
                                   number="")

    return render_template("curve.html",
                           properties2=data.properties,
                           credit=credit,
                           data=data,
                           bread=data.bread,
                           title=data.title,
                           friends=data.friends,
                           downloads=data.downloads,
                           learnmore=learnmore_list())
Esempio n. 3
0
def render_curve_webpage_by_label(label):
    cpt0 = cputime()
    t0 = time.time()
    data = WebEC.by_label(label)
    if data == "Invalid label":
        return elliptic_curve_jump_error(label, {})
    if data == "Curve not found":
        return elliptic_curve_jump_error(label, {}, missing_curve=True)
    try:
        lmfdb_label = data.lmfdb_label
    except AttributeError:
        return elliptic_curve_jump_error(label, {})

    data.modform_display = url_for(".modular_form_display", label=lmfdb_label, number="")

    code = data.code()
    code['show'] = {'magma':'','pari':'','sage':''} # use default show names
    T =  render_template("ec-curve.html",
                         properties=data.properties,
                         credit=ec_credit(),
                         data=data,
                         # set default show names but actually code snippets are filled in only when needed
                         code=code,
                         bread=data.bread, title=data.title,
                         friends=data.friends,
                         downloads=data.downloads,
                         KNOWL_ID="ec.q.%s"%lmfdb_label,
                         BACKUP_KNOWL_ID="ec.q.%s"%data.lmfdb_iso,
                         learnmore=learnmore_list())
    ec_logger.debug("Total walltime: %ss"%(time.time() - t0))
    ec_logger.debug("Total cputime: %ss"%(cputime(cpt0)))
    return T
Esempio n. 4
0
def render_curve_webpage_by_label(label):
    from sage.misc.misc import cputime
    cpt0 = cputime()
    t0 = time.time()
    data = WebEC.by_label(label)
    if data == "Invalid label":
        return elliptic_curve_jump_error(label, {}, wellformed_label=False)
    if data == "Curve not found":
        return elliptic_curve_jump_error(label, {}, wellformed_label=True)
    try:
        lmfdb_label = data.lmfdb_label
    except AttributeError:
        return elliptic_curve_jump_error(label, {}, wellformed_label=False)

    data.modform_display = url_for(".modular_form_display", label=lmfdb_label, number="")

    code = data.code()
    code['show'] = {'magma':'','pari':'','sage':''} # use default show names
    T =  render_template("ec-curve.html",
                           properties2=data.properties,
                           credit=ec_credit(),
                           data=data,
                           # set default show names but actually code snippets are filled in only when needed
                           code=code,
                           bread=data.bread, title=data.title,
                           friends=data.friends,
                           downloads=data.downloads,
                           learnmore=learnmore_list())
    ec_logger.debug("Total walltime: %ss"%(time.time() - t0))
    ec_logger.debug("Total cputime: %ss"%(cputime(cpt0)))
    return T
Esempio n. 5
0
def render_curve_webpage_by_label(label):
    credit = 'John Cremona and Andrew Sutherland'
    data = WebEC.by_label(label)
    if data == "Invalid label":
        return elliptic_curve_jump_error(label, {}, wellformed_label=False)
    if data == "Curve not found":
        return elliptic_curve_jump_error(label, {}, wellformed_label=True)
    try:
        lmfdb_label = data.lmfdb_label
    except AttributeError:
        return elliptic_curve_jump_error(label, {}, wellformed_label=False)

    if data.twoadic_label:
        credit = credit.replace(' and',',') + ' and Jeremy Rouse'
    if data.data['iwdata']:
        credit = credit.replace(' and',',') + ' and Robert Pollack'
    data.modform_display = url_for(".modular_form_display", label=lmfdb_label, number="")

    code = data.code()
    code['show'] = {'magma':'','pari':'','sage':''} # use default show names
    return render_template("ec-curve.html",
                           properties2=data.properties,
                           credit=credit,
                           data=data,
                           # set default show names but actually code snippets are filled in only when needed
                           code=code,
                           bread=data.bread, title=data.title,
                           friends=data.friends,
                           downloads=data.downloads,
                           learnmore=learnmore_list())
Esempio n. 6
0
def render_curve_webpage_by_label(label):
    credit = "John Cremona and Andrew Sutherland"
    data = WebEC.by_label(label)
    if data == "Invalid label":
        return elliptic_curve_jump_error(label, {}, wellformed_label=False)
    if data == "Curve not found":
        return elliptic_curve_jump_error(label, {}, wellformed_label=True)
    try:
        lmfdb_label = data.lmfdb_label
    except AttributeError:
        return elliptic_curve_jump_error(label, {}, wellformed_label=False)

    if data.twoadic_label:
        credit = credit.replace(" and", ",") + " and Jeremy Rouse"
    data.modform_display = url_for(".modular_form_display", label=lmfdb_label, number="")

    return render_template(
        "curve.html",
        properties2=data.properties,
        credit=credit,
        data=data,
        bread=data.bread,
        title=data.title,
        friends=data.friends,
        downloads=data.downloads,
        learnmore=learnmore_list(),
    )
Esempio n. 7
0
def ec_code(**args):
    label = curve_lmfdb_label(args['conductor'], args['iso'], args['number'])
    E = WebEC.by_label(label)
    Ecode = E.code()
    lang = args['download_type']
    code = "%s %s code for working with elliptic curve %s\n\n" % (Comment[lang],Fullname[lang],label)
    if lang=='gp':
        lang = 'pari'
    for k in sorted_code_names:
        if lang in Ecode[k]:
            code += "\n%s %s: \n" % (Comment[lang],code_names[k])
            code += Ecode[k][lang] + ('\n' if not '\n' in Ecode[k][lang] else '')
    return code
Esempio n. 8
0
def ec_code(**args):
    label = curve_lmfdb_label(args['conductor'], args['iso'], args['number'])
    E = WebEC.by_label(label)
    Ecode = E.code()
    lang = args['download_type']
    code = "%s %s code for working with elliptic curve %s\n\n" % (Comment[lang],Fullname[lang],label)
    if lang=='gp':
        lang = 'pari'
    for k in sorted_code_names:
        if lang in Ecode[k]:
            code += "\n%s %s: \n" % (Comment[lang],code_names[k])
            code += Ecode[k][lang] + ('\n' if not '\n' in Ecode[k][lang] else '')
    return code
Esempio n. 9
0
def ec_code(**args):
    print("args has keys %s" %  to_dict(args).keys())
    label = curve_lmfdb_label(args['conductor'], args['iso'], args['number'])
    E = WebEC.by_label(label)
    lang = args['download_type']
    code = "%s %s code for working with elliptic curve %s\n\n" % (Comment[lang],Fullname[lang],label)
    if lang=='gp':
        lang = 'pari'
    for k in sorted_code_names:
        if lang in E.code[k]:
            code += "\n%s %s: \n" % (Comment[lang],code_names[k])
            for line in E.code[k][lang]:
                code += line + "\n"
    return code
Esempio n. 10
0
def ec_code(**args):
    print("args has keys %s" % to_dict(args).keys())
    label = curve_lmfdb_label(args['conductor'], args['iso'], args['number'])
    E = WebEC.by_label(label)
    lang = args['download_type']
    code = "%s %s code for working with elliptic curve %s\n\n" % (
        Comment[lang], Fullname[lang], label)
    if lang == 'gp':
        lang = 'pari'
    for k in sorted_code_names:
        if lang in E.code[k]:
            code += "\n%s %s: \n" % (Comment[lang], code_names[k])
            for line in E.code[k][lang]:
                code += line + "\n"
    return code
Esempio n. 11
0
def ec_code(**args):
    label = curve_lmfdb_label(args['conductor'], args['iso'], args['number'])
    E = WebEC.by_label(label)
    if E == "Invalid label":
        return elliptic_curve_jump_error(label, {})
    if E == "Curve not found":
        return elliptic_curve_jump_error(label, {}, missing_curve=True)
    Ecode = E.code()
    lang = args['download_type']
    code = "%s %s code for working with elliptic curve %s\n\n" % (Comment[lang],Fullname[lang],label)
    if lang=='gp':
        lang = 'pari'
    for k in sorted_code_names:
        if lang in Ecode[k]:
            code += "\n%s %s: \n" % (Comment[lang],code_names[k])
            code += Ecode[k][lang] + ('\n' if '\n' not in Ecode[k][lang] else '')
    return code