(parser: argparse.ArgumentParser)
return parser
Get the argument parser for this module

    Useful if you want to use this module as a component of another CLI program
    and want to add its arguments.

    :param parser: A parser to add arguments to. If not specified, one will be
                   created.
    :returns argparse.ArgumentParser: The parser with arguments added.
Get the argument parser for this module
Get the argument parser for this module
def get_arguments(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
    """Get the argument parser for this module

    Useful if you want to use this module as a component of another CLI program
    and want to add its arguments.

    :param parser: A parser to add arguments to. If not specified, one will be
                   created.
    :returns argparse.ArgumentParser: The parser with arguments added.
    """
    parser.add_argument(
        "-l",
        "--log-level",
        choices=["debug", "info", "warning", "error", "none"],
        default="warning",
        help="Specify the level filter for logs to show on the command line. "
        'Log levels below warning can be chatty. If "none", do not show logs',
    )

    parser.add_argument(
        "-L",
        "--custom-labware-path",
        action="append",
        default=[os.getcwd()],
        help="Specify directories to search for custom labware definitions. "
        "You can specify this argument multiple times. Once you specify "
        "a directory in this way, labware definitions in that directory "
        "will become available in ProtocolContext.load_labware(). "
        "Only directories specified directly by "
        "this argument are searched, not their children. JSON files that "
        "do not define labware will be ignored with a message. "
        "By default, the current directory (the one from which you are "
        "invoking this program) will be searched for labware.",
    )
    parser.add_argument(
        "-D",
        "--custom-data-path",
        action="append",
        nargs="?",
        const=".",
        default=[],
        help="Specify directories to search for custom data files. "
        "You can specify this argument multiple times. Once you specify "
        "a directory in this way, files located in the specified "
        "directory will be available in ProtocolContext.bundled_data. "
        "Note that bundle execution will still only allow data files in "
        "the bundle. If you specify this without a path, it will "
        "add the current path implicitly. If you do not specify this "
        "argument at all, no data files will be added. Any file in the "
        "specified paths will be loaded into memory and included in the "
        "bundle if --bundle is passed, so be careful that any directory "
        "you specify has only the files you want. It is usually a "
        "better idea to use -d so no files are accidentally included. "
        "Also note that data files are made available as their name, not "
        "their full path, so name them uniquely.",
    )
    parser.add_argument(
        "-s",
        "--custom-hardware-simulator-file",
        type=str,
        default=None,
        help="Specify a file that describes the features present in the "
        "hardware simulator. Features can be instruments, modules, and "
        "configuration.",
    )
    parser.add_argument(
        "-d",
        "--custom-data-file",
        action="append",
        default=[],
        help="Specify data files to be made available in "
        "ProtocolContext.bundled_data (and possibly bundled if --bundle "
        "is passed). Can be specified multiple times with different "
        "files. It is usually a better idea to use this than -D because "
        "there is less possibility of accidentally including something.",
    )
    if allow_bundle():
        parser = _get_bundle_args(parser)

    parser.add_argument(
        "-e",
        "--estimate-duration",
        action="store_true",
        # TODO (AL, 2021-07-26): Better wording.
        help="Estimate how long the protocol will take to complete."
        " This is an experimental feature.",
    )

    parser.add_argument(
        "protocol",
        metavar="PROTOCOL",
        type=argparse.FileType("rb"),
        help="The protocol file to simulate. If you pass '-', you can pipe "
        "the protocol via stdin; this could be useful if you want to use this "
        "utility as part of an automated workflow.",
    )
    parser.add_argument(
        "-v",
        "--version",
        action="version",
        version=f"%(prog)s {opentrons.__version__}",
        help="Print the opentrons package version and exit",
    )
    parser.add_argument(
        "-o",
        "--output",
        action="store",
        help="What to output during simulations",
        choices=["runlog", "nothing"],
        default="runlog",
    )
    return parser
def get_arguments ( parser : argparse . ArgumentParser ) -> argparse . ArgumentParser : parser . add_argument ( "-l" , "--log-level" , choices = [ "debug" , "info" , "warning" , "error" , "none" ] , default = "warning" , help = "Specify the level filter for logs to show on the command line. " 'Log levels below warning can be chatty. If "none", do not show logs' , ) parser . add_argument ( "-L" , "--custom-labware-path" , action = "append" , default = [ os . getcwd ( ) ] , help = "Specify directories to search for custom labware definitions. " "You can specify this argument multiple times. Once you specify " "a directory in this way, labware definitions in that directory " "will become available in ProtocolContext.load_labware(). " "Only directories specified directly by " "this argument are searched, not their children. JSON files that " "do not define labware will be ignored with a message. " "By default, the current directory (the one from which you are " "invoking this program) will be searched for labware." , ) parser . add_argument ( "-D" , "--custom-data-path" , action = "append" , nargs = "?" , const = "." , default = [ ] , help = "Specify directories to search for custom data files. " "You can specify this argument multiple times. Once you specify " "a directory in this way, files located in the specified " "directory will be available in ProtocolContext.bundled_data. " "Note that bundle execution will still only allow data files in " "the bundle. If you specify this without a path, it will " "add the current path implicitly. If you do not specify this " "argument at all, no data files will be added. Any file in the " "specified paths will be loaded into memory and included in the " "bundle if --bundle is passed, so be careful that any directory " "you specify has only the files you want. It is usually a " "better idea to use -d so no files are accidentally included. " "Also note that data files are made available as their name, not " "their full path, so name them uniquely." , ) parser . add_argument ( "-s" , "--custom-hardware-simulator-file" , type = str , default = None , help = "Specify a file that describes the features present in the " "hardware simulator. Features can be instruments, modules, and " "configuration." , ) parser . add_argument ( "-d" , "--custom-data-file" , action = "append" , default = [ ] , help = "Specify data files to be made available in " "ProtocolContext.bundled_data (and possibly bundled if --bundle " "is passed). Can be specified multiple times with different " "files. It is usually a better idea to use this than -D because " "there is less possibility of accidentally including something." , ) if allow_bundle ( ) : parser = _get_bundle_args ( parser ) parser . add_argument ( "-e" , "--estimate-duration" , action = "store_true" , # TODO (AL, 2021-07-26): Better wording. help = "Estimate how long the protocol will take to complete." " This is an experimental feature." , ) parser . add_argument ( "protocol" , metavar = "PROTOCOL" , type = argparse . FileType ( "rb" ) , help = "The protocol file to simulate. If you pass '-', you can pipe " "the protocol via stdin; this could be useful if you want to use this " "utility as part of an automated workflow." , ) parser . add_argument ( "-v" , "--version" , action = "version" , version = f"%(prog)s {opentrons.__version__}" , help = "Print the opentrons package version and exit" , ) parser . add_argument ( "-o" , "--output" , action = "store" , help = "What to output during simulations" , choices = [ "runlog" , "nothing" ] , default = "runlog" , ) return parser