def arg_parse():
    """"""
    parser = argparse.ArgumentParser(
        description='Download Soils Shapefiles',
        formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    parser.add_argument('-i',
                        '--ini',
                        required=True,
                        metavar='INI',
                        type=lambda x: util.is_valid_file(parser, x),
                        help='Input INI File')
    parser.add_argument('-o',
                        '--overwrite',
                        default=None,
                        action="store_true",
                        help='Force overwrite of existing files')
    parser.add_argument('-d',
                        '--debug',
                        default=logging.INFO,
                        const=logging.DEBUG,
                        help='Debug level logging',
                        action="store_const",
                        dest="loglevel")
    args = parser.parse_args()

    # Convert input file to an absolute path
    if args.ini and os.path.isdir(os.path.abspath(args.ini)):
        args.ini = os.path.abspath(args.ini)

    return args
def arg_parse():
    """"""
    parser = argparse.ArgumentParser(
        description='ET-Demands Interpolate Spatial Crop Parameters',
        formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    parser.add_argument('-i',
                        '--ini',
                        metavar='PATH',
                        type=lambda x: util.is_valid_file(parser, x),
                        help='Input file')
    parser.add_argument('--zone',
                        default='county',
                        metavar='',
                        type=str,
                        choices=('huc8', 'huc10', 'county', 'gridmet'),
                        help='Zone type [{}]'.format(', '.join(
                            ['huc8', 'huc10', 'county', 'gridmet'])))
    parser.add_argument('-o',
                        '--overwrite',
                        default=False,
                        action='store_true',
                        help='Overwrite existing file')
    parser.add_argument('--debug',
                        default=logging.INFO,
                        const=logging.DEBUG,
                        help='Debug level logging',
                        action="store_const",
                        dest="loglevel")
    args = parser.parse_args()

    return args
Esempio n. 3
0
def arg_parse():
    """"""
    parser = argparse.ArgumentParser(
        description='ET-Demands Spatial Crop Parameters',
        formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    parser.add_argument('-i',
                        '--ini',
                        required=True,
                        metavar='INI',
                        type=lambda x: util.is_valid_file(parser, x),
                        help='Input file')
    parser.add_argument('--area',
                        default=10,
                        type=float,
                        help='Crop area threshold [acres]')
    parser.add_argument('--dairy',
                        default=5,
                        type=int,
                        help='Number of dairy hay cuttings')
    parser.add_argument('--beef',
                        default=4,
                        type=int,
                        help='Number of beef hay cuttings')
    parser.add_argument('--empty',
                        default=False,
                        action='store_true',
                        help='Remove empty features')
    parser.add_argument(
        '-c',
        '--crops',
        default='',
        type=str,
        help='Comma separated list or range of crops to compare')
    parser.add_argument('-o',
                        '--overwrite',
                        default=False,
                        action='store_true',
                        help='Overwrite existing file')
    parser.add_argument('--debug',
                        default=logging.INFO,
                        const=logging.DEBUG,
                        help='Debug level logging',
                        action="store_const",
                        dest="loglevel")
    args = parser.parse_args()

    # Convert input file to an absolute path
    if args.ini and os.path.isdir(os.path.abspath(args.ini)):
        args.ini = os.path.abspath(args.ini)

    return args
Esempio n. 4
0
def arg_parse():
    """"""
    parser = argparse.ArgumentParser(
        description='ET-Demands Interpolate Spatial Crop Parameters',
        formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    parser.add_argument(
        '-i', '--ini', metavar='PATH',
        type=lambda x: util.is_valid_file(parser, x), help='Input file')
    parser.add_argument(
        '--debug', default=logging.INFO, const=logging.DEBUG,
        help='Debug level logging', action="store_const", dest="loglevel")
    args = parser.parse_args()

    return args
def arg_parse():
    """"""
    parser = argparse.ArgumentParser(
        description='ET-Demands Static Files',
        formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    parser.add_argument('-i',
                        '--ini',
                        metavar='PATH',
                        type=lambda x: util.is_valid_file(parser, x),
                        help='Input file')
    parser.add_argument('--zone',
                        default='huc8',
                        metavar='STR',
                        type=str,
                        choices=('huc8', 'huc10', 'county', 'gridmet'),
                        help='Zone type [{}]'.format(', '.join(
                            ['huc8', 'huc10', 'county', 'gridmet'])))
    parser.add_argument('--acres',
                        default=10,
                        type=float,
                        help='Crop area threshold')
    parser.add_argument('--beef',
                        default=4,
                        type=int,
                        help='Number of beef hay cuttings')
    parser.add_argument('--dairy',
                        default=5,
                        type=int,
                        help='Number of dairy hay cuttings')
    parser.add_argument('-o',
                        '--overwrite',
                        default=None,
                        action='store_true',
                        help='Overwrite existing file')
    parser.add_argument('--clean',
                        default=None,
                        action='store_true',
                        help='Remove temporary datasets')
    parser.add_argument('--debug',
                        default=logging.INFO,
                        const=logging.DEBUG,
                        help='Debug level logging',
                        action="store_const",
                        dest="loglevel")
    args = parser.parse_args()

    return args
Esempio n. 6
0
def arg_parse():
    """"""
    parser = argparse.ArgumentParser(
        description='ET-Demands Spatial Crop Parameters',
        formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    parser.add_argument(
        '-i', '--ini', metavar='PATH',
        type=lambda x: util.is_valid_file(parser, x), help='Input file')
    parser.add_argument(
        '--zone', default='county', metavar='', type=str,
        choices=('huc8', 'huc10', 'county', 'gridmet'),
        help='Zone type [{}]'.format(
            ', '.join(['huc8', 'huc10', 'county', 'gridmet'])))
    parser.add_argument(
        '--area', default=10, type=float,
        help='Crop area threshold [acres]')
    parser.add_argument(
        '--dairy', default=5, type=int,
        help='Number of dairy hay cuttings')
    parser.add_argument(
        '--beef', default=4, type=int,
        help='Number of beef hay cuttings')
    parser.add_argument(
        '--empty', default=False, action='store_true',
        help='Remove empty features')
    parser.add_argument(
        '-c', '--crops', default='', type=str,
        help='Comma separated list or range of crops to compare')
    parser.add_argument(
        '-o', '--overwrite', default=False, action='store_true',
        help='Overwrite existing file')
    parser.add_argument(
        '--debug', default=logging.INFO, const=logging.DEBUG,
        help='Debug level logging', action="store_const", dest="loglevel")
    args = parser.parse_args()
    return args