schrodinger.application.bb_database.bb_arg_utils module¶
Does argument parsing and validation for bb_database_driver.py.
Copyright Schrodinger LLC, All Rights Reserved.
- schrodinger.application.bb_database.bb_arg_utils.BB_TASK¶
alias of
schrodinger.application.bb_database.bb_arg_utils.BBTask
- exception schrodinger.application.bb_database.bb_arg_utils.BBValidationError¶
Bases:
Exception
Used to simplify error passing in argument validation code.
- schrodinger.application.bb_database.bb_arg_utils.add_build_args(subparsers: argparse._SubParsersAction) None ¶
Add arguments for TASK.BUILD.
- schrodinger.application.bb_database.bb_arg_utils.add_describe_args(subparsers: argparse._SubParsersAction) None ¶
Add arguments for TASK.DESCRIBE.
- schrodinger.application.bb_database.bb_arg_utils.add_jobcontrol_args(parser: argparse.ArgumentParser, task: str) None ¶
Adds the ‘Job Control Options’ argument group to the supplied parser. Note that -HOST, -TMPDIR, -JOBNAME and -NOJOBID are all removed from the command line before reaching the parser, so these arguments are provided here only for the benefit of the help message. See -run_in_foreground for important information about running bb_database within a workflow.
- schrodinger.application.bb_database.bb_arg_utils.add_key_file_args(parser: argparse.ArgumentParser) None ¶
Adds the ‘Key File Options’ argument group to the supplied parser.
- schrodinger.application.bb_database.bb_arg_utils.add_optional_args_group(parser: argparse.ArgumentParser) argparse._ArgumentGroup ¶
Adds an ‘Optional Arguments’ argument group to the supplied parser with a standard -h, –help message and returns the argument group.
- schrodinger.application.bb_database.bb_arg_utils.add_qsplit_args(subparsers: argparse._SubParsersAction) None ¶
Add arguments for TASK.QSPLIT.
- schrodinger.application.bb_database.bb_arg_utils.add_qrun_args(subparsers: argparse._SubParsersAction) None ¶
Add arguments for TASK.QRUN.
- schrodinger.application.bb_database.bb_arg_utils.get_key_files(bbkeys: str) list[str] ¶
Returns key file names based on the bbkeys argument.
- schrodinger.application.bb_database.bb_arg_utils.get_parser() argparse.ArgumentParser ¶
Creates argparse.ArgumentParser with supported command line options.
- schrodinger.application.bb_database.bb_arg_utils.get_slice_limits(s: str) tuple[int, int] ¶
Returns slice limits parsed from a string of the form <min>:<max>, where either limit may be missing, in which case None is returned for the limt. Raises a ValueError if exactly one colon is not present, if <min> >= <max> or if a non-numeric limit is provided.
- schrodinger.application.bb_database.bb_arg_utils.validate_bbkeys(args: argparse.Namespace) None ¶
Raises a BBValidationError if args.bbkeys is invalid.
- schrodinger.application.bb_database.bb_arg_utils.validate_build_args(args: argparse.Namespace) None ¶
Raises a BBValidationError if the TASK.BUILD arguments are invalid.
- schrodinger.application.bb_database.bb_arg_utils.validate_dbpath(dbpath: str) None ¶
Raises a BBValidationError if dbpath has the wrong extension or is not an absolute path.
- schrodinger.application.bb_database.bb_arg_utils.validate_qrun_args(args: argparse.Namespace) None ¶
Raises a BBValidationError if the TASK.QRUN arguments are invalid.
- schrodinger.application.bb_database.bb_arg_utils.validate_qsplit_args(args: argparse.Namespace) None ¶
Raises a BBValidationError if the TASK.QSPLIT arguments are invalid.
- schrodinger.application.bb_database.bb_arg_utils.validate_slice_limits(s: str)¶
Raises a BBValidation error if the provided slice specification is invalid.
- schrodinger.application.bb_database.bb_arg_utils.validate_args(args: argparse.Namespace) tuple[bool, str] ¶
Checks the validity of parsed command line arguments at startup time, and returns a tuple of validity and a non-empty error message if not valid.