Ejemplo n.º 1
0
Archivo: init.py Proyecto: zyxue/pybin
def parse_cmd():
    """parse_cmd"""
    parser = aa.my_basic_parser()

    parser.add_argument('--nt', type=int, dest='numthread', default=16,
                        help='specify the number of threads, default is 16')
    parser.add_argument('-a','--type_of_analysis', type=str, dest='toa', required=True,
                        help='available_options:\n{0!r}'.format(sorted(ANALYSIS_METHODS.keys())))
    parser.add_argument('-b', type=int, dest='btime', default=0,
                        help='specify the beginning time, corresponding to the -b option in gromacs (ps)')
    parser.add_argument('-e', type=int, dest='etime', default=0,
                        help='specify the ending time, corresponding to the -e option in gromacs (ps)')
    parser.add_argument('--dt', type=int, dest='dt', default=0,
                        help='specify the dt, corresponding to the -dt option in gromacs (ps)')
    parser.add_argument('-g', type=str, dest='config_file', default='./.g_ana.conf',
                        help='specify the configuration file, default as ./g_ana.conf')
    parser.add_argument('--outputdir', type=str, dest='outputdir', default=None,
                        help='specify the output directory, which will overwrite that in .g_ana.conf')
    parser.add_argument('--test', dest='test', action='store_true', default=False, 
                        help='for debugging, commands will be printed rather than executed')
    parser.add_argument('--nolog', dest='nolog', action='store_true', default=False,
                        help='stdout will be printed to the screen rather than collected in a log file')
    parser.add_argument('--cdb', dest='cdb', action='store_true', default=False,
                        help=''.join(['if you need different b values for different trjectory,', 
                                     'and they are stored in a database specified in your .g_ana.conf']))
    args = parser.parse_args()
    return args
Ejemplo n.º 2
0
def parse_cmd(cmd=None):
    """parse_cmd"""

    parser = argparse_action.my_basic_parser()
    parser.add_argument('-a', '--property-name', type=str, dest='ppty', required=True,
                        help='you must specify the --property-name option from {0!r}'.format(TABLES))
    parser.add_argument('-g', dest='conf', default=".h5.conf",
                        help='specify the configuration file')
    parser.add_argument('--nobk', dest='nobk', action='store_true', default=False,
                        help=('don\'t backup to save time, especially when the h5 file is big,'
                              'make sure your code works before using this option,'
                              'otherwise h5 file may be corrupted, and data lost'))
    if cmd is None:
        cmd = sys.argv[1:]

    args = parser.parse_args()

    return args
Ejemplo n.º 3
0
Archivo: utils.py Proyecto: zyxue/pybin
def parse_cmd(cmd=None):
    parser = aa.my_basic_parser()
    parser.add_argument(
        "-p",
        "--property-name",
        type=str,
        dest="ppty",
        required=True,
        help="you must specify the --property-name option from {0!r}".format(h5tables.__tables__),
    )
    parser.add_argument("-a", dest="tpostproc", required=True, help="type of postprocess. e.g. ave, alx")
    parser.add_argument("-g", dest="conf", default=".h5.conf", help="specify the configuration file")

    if cmd is None:
        cmd = sys.argv[1:]

    args = parser.parse_args(cmd)
    return args