Ejemplo n.º 1
0
def main():  
    desc = """ccp4-python -m ample.testing <command> [<args>]

Available tests include:
   integration     Integration testing of typical Ample routines
   unittest        Unittesting of all Ample subroutines
"""
    
    parser = argparse.ArgumentParser(prog="run_tests.py", usage=desc)
    
    # Add options that work on all runtypes
    add_core_options(parser)
    
    suboptions = parser.add_subparsers(help="Testing framework options")
    
    integ = suboptions.add_parser("integration", help="Integration testing with examples")
    integ.set_defaults(which="integration")
    integration_util.add_cmd_options(integ)
    add_cluster_submit_options(integ)
    
    unit = suboptions.add_parser("unittest", help="Unittest all functions")
    unit.set_defaults(which="unittest")
    unittest_util.add_cmd_options(unit)
    
    argd = vars(parser.parse_args())
    
    which_test = argd['which']
    if which_test is 'integration':
        run_integration(argd)
    elif which_test is 'unittest':
        run_unittest(argd)
Ejemplo n.º 2
0
def main():
    desc = """ccp4-python -m ample.testing <command> [<args>]

Available tests include:
   integration     Integration testing of typical Ample routines
   unittest        Unittesting of all Ample subroutines
"""

    parser = argparse.ArgumentParser(prog="run_tests.py", usage=desc)

    # Add options that work on all runtypes
    add_core_options(parser)

    suboptions = parser.add_subparsers(help="Testing framework options")

    integ = suboptions.add_parser("integration",
                                  help="Integration testing with examples")
    integ.set_defaults(which="integration")
    integration_util.add_cmd_options(integ)
    add_cluster_submit_options(integ)

    unit = suboptions.add_parser("unittest", help="Unittest all functions")
    unit.set_defaults(which="unittest")
    unittest_util.add_cmd_options(unit)

    argd = vars(parser.parse_args())

    which_test = argd['which']
    if which_test is 'integration':
        run_integration(argd)
    elif which_test is 'unittest':
        run_unittest(argd)
Ejemplo n.º 3
0
    def process_command_line(self,
                             args=None,
                             contacts=True,
                             modelling=True,
                             mol_rep=True):
        """Process the command-line.
        :args: optional argument that can hold the command-line arguments if we 
        have been called from within python for testing
        """
        parser = argparse.ArgumentParser(
            description=
            "AMPLE: Ab initio Modelling of Proteins for moLEcular replacement",
            prefix_chars="-")
        argparse_util.add_general_options(parser)
        argparse_util.add_cluster_submit_options(parser)
        ensembler.add_argparse_options(parser)

        if contacts:
            argparse_util.add_contact_options(parser)
        if mol_rep:
            argparse_util.add_mr_options(parser)
        if modelling:
            argparse_util.add_rosetta_options(parser)

        return parser.parse_args(args)
Ejemplo n.º 4
0
import argparse
import os
import sys

from ample.constants import AMPLE_PKL
from ample import ensembler
from ample.util import ample_util, config_util, exit_util, logging_util, process_models
from ample.util import argparse_util
from ample.util.options_processor import process_ensemble_options

ENSEMBLE_DIRNAME = 'ample_ensemble'

parser = argparse.ArgumentParser(description="AMPLE Ensembling Module")
argparse_util.add_general_options(parser)
argparse_util.add_cluster_submit_options(parser)
argparse_util.add_ensembler_options(parser)

# Get command-line arguments and see if we have a restart_pkl option as this
# is how we pass in an existing ample dictionary when we are running the ensembling
# as a standalone job on a cluster
optd = vars(parser.parse_args())

# Track restart as it determines if we need to unpack models
restart = False
if 'restart_pkl' in optd and optd['restart_pkl']:
    if not os.path.isfile(optd['restart_pkl']):
        msg = 'Cannot find ensemble pkl file: {0}'.format(optd['restart_pkl'])
        exit_util.exit_error(msg)
    try:
        optd = ample_util.read_amoptd(optd['restart_pkl'])
Ejemplo n.º 5
0
import argparse
import os
import sys

from ample.constants import AMPLE_PKL
from ample import ensembler
from ample.util import ample_util, config_util, exit_util, logging_util
from ample.util import argparse_util

ENSEMBLE_DIRNAME = 'ample_ensemble'

# Set up the command-line parsing
parser = argparse.ArgumentParser(description="AMPLE Ensembling Module")
# Add options for running as a standalone module
argparse_util.add_general_options(parser)
argparse_util.add_cluster_submit_options(parser)
# Ensemble options
ensembler.add_argparse_options(parser)

# Get command-line arguments and see if we have a restart_pkl option as this
# is how we pass in an existing ample dictionary when we are running the ensembling
# as a standalone job on a cluster
args = parser.parse_args()
optd = vars(args)

# Track restart as it determines if we need to unpack models
restart = False
if 'restart_pkl' in optd and optd['restart_pkl']:
    if not os.path.isfile(optd['restart_pkl']):
        msg = 'Cannot find ensemble pkl file: {0}'.format(optd['restart_pkl'])
        exit_util.exit_error(msg)