schrodinger.application.desmond.starter.ui.cmdline module¶
Starter backbone
Copyright Schrodinger, LLC. All rights reserved.
-
class
schrodinger.application.desmond.starter.ui.cmdline.
Option
(name, default, help, dest, other_kwargs)¶ Bases:
tuple
-
name
¶ Alias for field number 0
-
default
¶ Alias for field number 1
-
help
¶ Alias for field number 2
-
dest
¶ Alias for field number 3
-
other_kwargs
¶ Alias for field number 4
-
__contains__
¶ Return key in self.
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
__len__
¶ Return len(self).
-
count
(value) → integer -- return number of occurrences of value¶
-
index
(value[, start[, stop]]) → integer -- return first index of value.¶ Raises ValueError if the value is not present.
-
-
schrodinger.application.desmond.starter.ui.cmdline.
define_options
(parser: argparse.ArgumentParser, options: List[schrodinger.application.desmond.starter.ui.cmdline.Option])¶ Define the options on a specified parser.
Parameters: - parser – Add options to this parser.
- options – List of options in the format (name, default, help, destination).
-
schrodinger.application.desmond.starter.ui.cmdline.
parse_known_options
(usage: str, options: List[schrodinger.application.desmond.starter.ui.cmdline.Option], argv: List[str]) → Tuple[argparse.Namespace, Optional[str]]¶ Parse and return the parsed options.
Parameters: - usage – Usage to display if no arguments given.
- options – List of options in the format (name, default, help, destination).
- argv – List of input arguments.
Returns: (Known parsed options, unknown options)
Raises: SystemExit – If no arguments given, show the usage and exit.
-
schrodinger.application.desmond.starter.ui.cmdline.
parse_options
(usage: str, options: List[schrodinger.application.desmond.starter.ui.cmdline.Option], argv: List[str]) → Tuple[argparse.Namespace, Optional[str]]¶ Parse and return the parsed options.
Parameters: - usage – Usage to display if no arguments given.
- options – List of options in the format (name, default, help, destination).
- argv – List of input arguments.
Returns: Parsed options
Raises: SystemExit – If no arguments given or if there is unknown arguments, show the usage and exit.
-
schrodinger.application.desmond.starter.ui.cmdline.
get_parser
(usage: str, options: List[schrodinger.application.desmond.starter.ui.cmdline.Option], add_help: bool = True) → argparse.ArgumentParser¶ Return a parser with the specified options.
Parameters: - usage – Usage to display if no arguments given.
- options – List of options in the format (name, default, help, destination).
- add_help – Whether to add help flag to the parser
Returns: Configured parser
-
schrodinger.application.desmond.starter.ui.cmdline.
get_common_options
() → List[schrodinger.application.desmond.starter.ui.cmdline.Option]¶ Return list of options common to all fep scripts.
Returns: List of options that are common to all fep scripts.
-
class
schrodinger.application.desmond.starter.ui.cmdline.
BaseArgs
(opt: argparse.Namespace)¶ Bases:
object
Base class for arguments.
-
__init__
(opt: argparse.Namespace)¶ Parameters: - opt – Command line options with corresponding values.
- inp_file – Input file name
-
validate
()¶ Validate the parameters.
Raises: SystemExit – For invalid parameters.
-
copy_parser_attributes
(opt)¶ Copy parser options (e.g: time, buffer, …) from ArgumentParser to
self
.Subclass needs to call this method in __init__
-
check_ppj
()¶ Raise a warning if restarting and trying to set ppj.
Raises: UserWarning – If ppj set for a restarted job.
-
set_restart
()¶ Set the RESTART flag if only the checkpoint is given.
-
generate_jobname
()¶ If the JOBNAME was not set and not RESTART’ing, automatically generate a job name.
-