Exemplo n.º 1
0
def networkDrawPDF(request, networkKey):
    """
    A view called when a user wants to draw the potential energy surface for
    a given Network in PDF format.
    """
    from rmgpy.measure.main import execute

    network = get_object_or_404(Network, pk=networkKey)

    # Run MEASURE to draw the PES
    execute(inputFile=network.getInputFilename(), drawFile=network.getSurfaceFilenamePDF())

    # Go back to the network's main page
    return HttpResponseRedirect(reverse(networkIndex, args=(network.pk,)))
Exemplo n.º 2
0
def networkRun(request, networkKey):
    """
    A view called when a user wants to run MEASURE on the input file for a
    given Network.
    """
    from rmgpy.measure.main import execute

    network = get_object_or_404(Network, pk=networkKey)

    # Run MEASURE! This may take some time...
    execute(inputFile=network.getInputFilename(), outputFile=network.getOutputFilename())

    # Go back to the network's main page
    return HttpResponseRedirect(reverse(networkIndex, args=(network.pk,)))
Exemplo n.º 3
0
def networkDrawSVG(request, networkKey):
    """
    A view called when a user wants to draw the potential energy surface for
    a given Network in SVG format.
    """
    from rmgpy.measure.main import execute

    network = get_object_or_404(Network, pk=networkKey)

    # Run MEASURE to draw the PES
    # For some reason SVG drawing seems to be much slower than the other formats
    execute(inputFile=network.getInputFilename(), drawFile=network.getSurfaceFilenameSVG())

    # Go back to the network's main page
    return HttpResponseRedirect(reverse(networkIndex, args=(network.pk,)))
Exemplo n.º 4
0
def networkRun(request, networkKey):
    """
    A view called when a user wants to run MEASURE on the input file for a
    given Network.
    """
    from rmgpy.measure.main import execute

    network = get_object_or_404(Network, pk=networkKey)

    # Run MEASURE! This may take some time...
    execute(
        inputFile=network.getInputFilename(),
        outputFile=network.getOutputFilename(),
    )

    # Go back to the network's main page
    return HttpResponseRedirect(reverse(networkIndex, args=(network.pk, )))
Exemplo n.º 5
0
def networkDrawPDF(request, networkKey):
    """
    A view called when a user wants to draw the potential energy surface for
    a given Network in PDF format.
    """
    from rmgpy.measure.main import execute

    network = get_object_or_404(Network, pk=networkKey)

    # Run MEASURE to draw the PES
    execute(
        inputFile=network.getInputFilename(),
        drawFile=network.getSurfaceFilenamePDF(),
    )

    # Go back to the network's main page
    return HttpResponseRedirect(reverse(networkIndex, args=(network.pk, )))
Exemplo n.º 6
0
def networkDrawSVG(request, networkKey):
    """
    A view called when a user wants to draw the potential energy surface for
    a given Network in SVG format.
    """
    from rmgpy.measure.main import execute

    network = get_object_or_404(Network, pk=networkKey)

    # Run MEASURE to draw the PES
    # For some reason SVG drawing seems to be much slower than the other formats
    execute(
        inputFile=network.getInputFilename(),
        drawFile=network.getSurfaceFilenameSVG(),
    )

    # Go back to the network's main page
    return HttpResponseRedirect(reverse(networkIndex, args=(network.pk, )))
Exemplo n.º 7
0
        help='draw potential energy surface and exit')
    group1.add_argument('-o', '--output', metavar='OUTFILE', type=str, nargs=1,
        help='specify location of output file')

    # Options for controlling the amount of information printed to the console
    # By default a moderate level of information is printed; you can either
    # ask for less (quiet), more (verbose), or much more (debug)
    group2 = parser.add_mutually_exclusive_group()
    group2.add_argument('-q', '--quiet', action='store_true', help='only print warnings and errors')
    group2.add_argument('-v', '--verbose', action='store_true', help='print more verbose output')

    return parser.parse_args()

################################################################################

if __name__ == '__main__':
    
    # Parse the command-line arguments
    args = parseCommandLineArguments()
    
    quiet = args.quiet
    verbose = args.verbose
    
    inputFile = args.file[0]
    outputFile = args.output[0] if args.output is not None else None
    drawFile = args.draw[0] if args.draw is not None else None
    
    # Run MEASURE
    from rmgpy.measure.main import execute
    execute(inputFile, outputFile=outputFile, drawFile=drawFile, logFile=None, quiet=quiet, verbose=verbose)