Пример #1
0
def parse_arguments(args):
    """
    :param args: the script arguments specified by the user
    :return: the parsed known argument values (<class 'argparse.Namespace'>
    Python object)

    Parse the known arguments.
    """

    parser = ArgumentParser(
        add_help=True,
        parents=[
            get_db_parser(),
            get_required_e2e_arguments_parser(),
            get_solve_parser(),
            get_parallel_get_inputs_parser(),
            get_parallel_solve_parser(),
        ],
    )

    # Arguments to skip an E2E step
    parser.add_argument(
        "--skip_get_inputs",
        default=False,
        action="store_true",
        help="Skip the 'get_scenario_inputs' E2E step.",
    )
    parser.add_argument(
        "--skip_run_scenario",
        default=False,
        action="store_true",
        help="Skip the 'run_scenario' E2E step.",
    )
    parser.add_argument(
        "--skip_import_results",
        default=False,
        action="store_true",
        help="Skip the 'import_scenario_results' E2E step.",
    )
    parser.add_argument(
        "--skip_process_results",
        default=False,
        action="store_true",
        help="Skip the 'process_results' E2E step.",
    )

    # Run only a single E2E step
    parser.add_argument(
        "--single_e2e_step_only",
        choices=[
            "get_inputs", "run_scenario", "import_results", "process_results"
        ],
        help="Run only the specified E2E step. All others "
        "will be skipped.",
    )

    parsed_arguments = parser.parse_args(args=args)

    return parsed_arguments
Пример #2
0
def parse_arguments(args):
    """
    :param args: the script arguments specified by the user
    :return: the parsed known argument values (<class 'argparse.Namespace'>
    Python object)

    Parse the known arguments.
    """
    parser = ArgumentParser(
        add_help=True, parents=[get_db_parser(), get_required_e2e_arguments_parser()]
    )
    parsed_arguments = parser.parse_known_args(args=args)[0]

    return parsed_arguments
Пример #3
0
def parse_arguments(args):
    """
    :param args: the script arguments specified by the user
    :return: the parsed known argument values (<class 'argparse.Namespace'>
    Python object)

    Parse the known arguments.
    """
    parser = ArgumentParser(add_help=True, parents=[get_db_parser()])

    # Add quiet flag which can suppress run output
    parser.add_argument("--quiet",
                        default=False,
                        action="store_true",
                        help="Don't print run output.")

    parsed_arguments = parser.parse_known_args(args=args)[0]

    return parsed_arguments