Exemplo n.º 1
0
def generic():
    """
    Pull up Generic Grid plot the results and download
    """

    # Grab the inputs arguments from the URL
    args = dict(flask.request.args)
    fig, fh, closest_match, error_message = generic_grid(args)

    # Write table string
    table_string = fh.getvalue()

    # Web-ify bokeh plot
    js_resources = INLINE.render_js()
    css_resources = INLINE.render_css()

    script, div = components(fig)

    html = flask.render_template(
        'generic.html',
        inputs=args,
        closest_match=closest_match,
        error_message=error_message,
        table_string=table_string,
        plot_script=script,
        plot_div=div,
        js_resources=js_resources,
        css_resources=css_resources,
    )
    return encode_utf8(html)
Exemplo n.º 2
0
def generic():
    """
    Pull up Generic Grid plot the results and download

    Returns
    -------
    html: ``flask.render_template`` obj
        The rendered template for the generic grid page.
    """

    # Grab the inputs arguments from the URL
    args = dict(flask.request.args)
    fig, fh, closest_match, error_message = generic_grid(args)

    # Write table string
    table_string = fh.getvalue()

    # Web-ify bokeh plot
    js_resources = INLINE.render_js()
    css_resources = INLINE.render_css()

    script, div = components(fig)

    html = flask.render_template(
        'generic.html',
        inputs=args,
        closest_match=closest_match,
        error_message=error_message,
        table_string=table_string,
        plot_script=script,
        plot_div=div,
        js_resources=js_resources,
        css_resources=css_resources,
    )

    # Log the form inputs
    if len(args) > 0:
        log_exoctk.log_form_input(args, 'generic', DB)

    return html
Exemplo n.º 3
0
 def test_model(self):
     """Test that fortney_grid can be run"""
     fig, fh, closest_match, error_message = generic_grid(self.args,
                                                          write_plot=False,
                                                          write_table=False)