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

__add__

Return self+value.

__annotations__ = {'default': <class 'object'>, 'dest': typing.Dict, 'help': <class 'str'>, 'name': <class 'str'>, 'other_kwargs': typing.Dict}
__class__

alias of builtins.type

__contains__

Return key in self.

__delattr__

Implement delattr(self, name).

__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__getitem__

Return self[key].

__getnewargs__()

Return self as a plain tuple. Used by copy and pickle.

__gt__

Return self>value.

__hash__

Return hash(self).

__init__

Initialize self. See help(type(self)) for accurate signature.

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__iter__

Implement iter(self).

__le__

Return self<=value.

__len__

Return len(self).

__lt__

Return self<value.

__module__ = 'schrodinger.application.desmond.starter.ui.cmdline'
__mul__

Return self*value.n

__ne__

Return self!=value.

static __new__(_cls, name, default, help, dest=None, other_kwargs={})

Create new instance of Option(name, default, help, dest, other_kwargs)

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__()

Return a nicely formatted representation string

__rmul__

Return self*value.

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__slots__ = ()
__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

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_options(usage: str, options: List[schrodinger.application.desmond.starter.ui.cmdline.Option], argv: List[str]) → Tuple[argparse.Namespace, Union[str, NoneType]]

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, 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, inp_file: str = None)

Bases: object

Base class for arguments.

__init__(opt: argparse.Namespace, inp_file: str = None)
Parameters:
  • opt – Command line options with corresponding values.
  • inp_file – Input file name
validate()

Validate the parameters for missing files.

Raises:SystemExit – For invalid parameters.
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.

__str__()

Return str(self).

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.desmond.starter.ui.cmdline', '__doc__': '\n Base class for arguments.\n ', '__init__': <function BaseArgs.__init__>, 'validate': <function BaseArgs.validate>, 'check_ppj': <function BaseArgs.check_ppj>, 'set_restart': <function BaseArgs.set_restart>, 'generate_jobname': <function BaseArgs.generate_jobname>, '__str__': <function BaseArgs.__str__>, '__dict__': <attribute '__dict__' of 'BaseArgs' objects>, '__weakref__': <attribute '__weakref__' of 'BaseArgs' objects>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.desmond.starter.ui.cmdline'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)