schrodinger.tasks.jobtasks module¶
-
schrodinger.tasks.jobtasks.
is_jobtask
(task)¶ Utility function to check if an object is a jobtask.
-
class
schrodinger.tasks.jobtasks.
AllowedHostTypes
(*args, **kwargs)¶ Bases:
schrodinger.models.jsonable.JsonableEnum
An enumeration.
-
CPU_ONLY
= 1¶
-
GPU_ONLY
= 2¶
-
CPU_AND_GPU
= 3¶
-
-
class
schrodinger.tasks.jobtasks.
HostParam
(default_value='localhost', allowed_types=<AllowedHostTypes.CPU_ONLY: 1>, *args, **kwargs)¶ Bases:
schrodinger.models.parameters.Param
-
DataClass
¶ alias of
schrodinger.tasks.hosts.Host
-
__init__
(default_value='localhost', allowed_types=<AllowedHostTypes.CPU_ONLY: 1>, *args, **kwargs)¶ Parameters: - default_value (object) – The value to use in constructing the default
value for the param. A new param will have the value returned by
DataClass(default_value)
. - DataClass (type) – The type to use for values of this param.
- deepcopyable (bool) – Whether values of this param are deepcopyable. If this param is not deepcopyable and its owner param is deepcopied, the copy’s subparam value will be identical.
- _param_type – For internal use only.
- default_value (object) – The value to use in constructing the default
value for the param. A new param will have the value returned by
-
blockSignals
(self, bool) → bool¶
-
childEvent
(self, QChildEvent)¶
-
children
(self) → List[QObject]¶
-
connectNotify
(self, QMetaMethod)¶
-
customEvent
(self, QEvent)¶
-
classmethod
defaultValue
(*args, **kwargs)¶
-
deleteLater
(self)¶
-
destroyed
¶ destroyed(self, object: QObject = None) [signal]
-
disconnect
(self)¶
-
disconnectNotify
(self, QMetaMethod)¶
-
dumpObjectInfo
(self)¶
-
dumpObjectTree
(self)¶
-
dynamicPropertyNames
(self) → List[QByteArray]¶
-
event
(self, QEvent) → bool¶
-
eventFilter
(self, QObject, QEvent) → bool¶
-
findChild
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject¶ findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
-
findChildren
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]¶ findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
-
classmethod
getParamSignal
(*args, **kwargs)¶
-
classmethod
getParamValue
(*args, **kwargs)¶
-
getTypeHint
()¶
-
inherits
(self, str) → bool¶
-
initAbstract
()¶
-
installEventFilter
(self, QObject)¶
-
classmethod
isAbstract
()¶ Whether the param is an “abstract” param.
-
isSignalConnected
(self, QMetaMethod) → bool¶
-
isWidgetType
(self) → bool¶
-
isWindowType
(self) → bool¶
-
killTimer
(self, int)¶
-
metaObject
(self) → QMetaObject¶
-
moveToThread
(self, QThread)¶
-
objectName
(self) → str¶
-
objectNameChanged
¶ objectNameChanged(self, str) [signal]
-
classmethod
owner
()¶ Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
-
classmethod
ownerChain
()¶ Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
-
classmethod
paramName
()¶ Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
-
parent
(self) → QObject¶
-
property
(self, str) → Any¶
-
pyqtConfigure
(...)¶ Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
-
receivers
(self, PYQT_SIGNAL) → int¶
-
removeEventFilter
(self, QObject)¶
-
sender
(self) → QObject¶
-
senderSignalIndex
(self) → int¶
-
setObjectName
(self, str)¶
-
classmethod
setParamValue
(*args, **kwargs)¶
-
setParent
(self, QObject)¶
-
setProperty
(self, str, Any) → bool¶
-
signalsBlocked
(self) → bool¶
-
startTimer
(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int¶
-
staticMetaObject
= <PyQt5.QtCore.QMetaObject object>¶
-
thread
(self) → QThread¶
-
timerEvent
(self, QTimerEvent)¶
-
tr
(self, str, disambiguation: str = None, n: int = -1) → str¶
-
-
schrodinger.tasks.jobtasks.
get_hosts
()¶
-
schrodinger.tasks.jobtasks.
get_default_host
(allowed_host_types=<AllowedHostTypes.CPU_AND_GPU: 3>)¶ Gets the default host for a job to run on. Which will be the jobhost if this function is called from within a jobcontrol backend, or the localhost otherwise. If the specified host type is GPU_ONLY, and the localhost and jobhost don’t have GPUs, then the returned host will be the first gpu-enabled host returned from
get_hosts()
.
-
class
schrodinger.tasks.jobtasks.
HostSettings
(default_value=<object object>, _param_type=<object object>, **kwargs)¶ Bases:
schrodinger.models.parameters.CompoundParam
-
host
¶
-
num_subjobs
¶ Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
-
allowed_host_types
¶
-
toCmdArg
()¶
-
initializeValue
()¶ Override to dynamically set up the default value of the param. Useful for default values that are determined at runtime. This is called any time the param is reset.
-
DataClass
¶ This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
-
__init__
(default_value=<object object>, _param_type=<object object>, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
addSubParam
(name, param, update_owner=True)¶
-
allowed_host_typesChanged
¶
-
allowed_host_typesReplaced
¶
-
blockSignals
(self, bool) → bool¶
-
block_signal_propagation
()¶
-
childEvent
(self, QChildEvent)¶
-
children
(self) → List[QObject]¶
-
classmethod
configureParam
()¶ Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
-
connectNotify
(self, QMetaMethod)¶
-
customEvent
(self, QEvent)¶
-
classmethod
defaultValue
(*args, **kwargs)¶
-
deleteLater
(self)¶
-
destroyed
¶ destroyed(self, object: QObject = None) [signal]
-
disconnect
(self)¶
-
disconnectNotify
(self, QMetaMethod)¶
-
dumpObjectInfo
(self)¶
-
dumpObjectTree
(self)¶
-
dynamicPropertyNames
(self) → List[QByteArray]¶
-
event
(self, QEvent) → bool¶
-
eventFilter
(self, QObject, QEvent) → bool¶
-
findChild
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject¶ findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
-
findChildren
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]¶ findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
-
classmethod
fromJson
(json_obj)¶ A factory method which constructs a new object from a given dict loaded from a json string or file.
Parameters: json_obj (dict) – A json-loaded dictionary to create an object from. Returns: An instance of this class. :rtype : cls
-
classmethod
fromJsonImplementation
(json_dict)¶ Sets the value of this compound param value object from a JSON dict.
-
getAbstractParam
(*args, **kwargs)¶
-
classmethod
getJsonBlacklist
()¶ Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
- Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
-
classmethod
getParamSignal
(*args, **kwargs)¶
-
classmethod
getParamValue
(*args, **kwargs)¶
-
classmethod
getSubParam
(name)¶ Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to accss params is generally discouraged, but can be useful for serializing/deserializing param data.
Parameters: name (str) – The name of the subparam to get the value for.
-
classmethod
getSubParams
()¶ Return a dictionary mapping subparam names to their values.
-
getTypeHint
()¶
-
get_version
()¶ Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
-
hostChanged
¶
-
hostReplaced
¶
-
inherits
(self, str) → bool¶
-
initAbstract
()¶
-
initConcrete
()¶ Override to customize initialization of concrete params.
-
installEventFilter
(self, QObject)¶
-
classmethod
isAbstract
()¶ Whether the param is an “abstract” param.
-
isDefault
(*args, **kwargs)¶
-
isSignalConnected
(self, QMetaMethod) → bool¶
-
isWidgetType
(self) → bool¶
-
isWindowType
(self) → bool¶
-
killTimer
(self, int)¶
-
metaObject
(self) → QMetaObject¶
-
moveToThread
(self, QThread)¶
-
num_subjobsChanged
¶
-
num_subjobsReplaced
¶
-
objectName
(self) → str¶
-
objectNameChanged
¶ objectNameChanged(self, str) [signal]
-
classmethod
owner
()¶ Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
-
classmethod
ownerChain
()¶ Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
-
classmethod
paramName
()¶ Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
-
parent
(self) → QObject¶
-
property
(self, str) → Any¶
-
pyqtConfigure
(...)¶ Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
-
receivers
(self, PYQT_SIGNAL) → int¶
-
removeEventFilter
(self, QObject)¶
-
reset
(*args, **kwargs)¶
-
sender
(self) → QObject¶
-
senderSignalIndex
(self) → int¶
-
setObjectName
(self, str)¶
-
classmethod
setParamValue
(*args, **kwargs)¶
-
setParent
(self, QObject)¶
-
setProperty
(self, str, Any) → bool¶
-
classmethod
setReference
(param1, param2)¶ Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
Parameters: - param1 – The first abstract param to keep synced
- param2 – The second abstract param. After instantiation, this param will take on the value of param1.
-
setValue
(*args, **kwargs)¶
-
signalsBlocked
(self) → bool¶
-
skip_eq_check
()¶
-
startTimer
(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int¶
-
staticMetaObject
= <PyQt5.QtCore.QMetaObject object>¶
-
thread
(self) → QThread¶
-
timerEvent
(self, QTimerEvent)¶
-
toDict
(*args, **kwargs)¶
-
toJson
(_mark_version=True)¶ Create and returns a data structure made up of jsonable items.
Return type: An instance of one the classes from NATIVE_JSON_DATATYPES
-
toJsonImplementation
(*args, **kwargs)¶
-
tr
(self, str, disambiguation: str = None, n: int = -1) → str¶
-
valueChanged
¶
-
-
class
schrodinger.tasks.jobtasks.
IncorporationMode
(*args, **kwargs)¶ Bases:
schrodinger.models.jsonable.JsonableEnum
An enumeration.
-
APPEND
= 'append'¶
-
APPENDINPLACE
= 'appendinplace'¶
-
REPLACE
= 'replace'¶
-
IGNORE
= 'ignore'¶
-
-
class
schrodinger.tasks.jobtasks.
IncorporationParam
(*args, allowed_modes=(<IncorporationMode.APPEND: 'append'>, <IncorporationMode.APPENDINPLACE: 'appendinplace'>, <IncorporationMode.IGNORE: 'ignore'>), **kwargs)¶ Bases:
schrodinger.models.parameters.EnumParam
-
DEFAULT_ALLOWED_MODES
= (<IncorporationMode.APPEND: 'append'>, <IncorporationMode.APPENDINPLACE: 'appendinplace'>, <IncorporationMode.IGNORE: 'ignore'>)¶
-
__init__
(*args, allowed_modes=(<IncorporationMode.APPEND: 'append'>, <IncorporationMode.APPENDINPLACE: 'appendinplace'>, <IncorporationMode.IGNORE: 'ignore'>), **kwargs)¶ EnumParam must be initialized with the Enum class that this param is to be based on as well as the default value.
Parameters: - enum_class (enum.Enum) – the enum class to base this pram on
- default_value (a member of the enum_class) – The default enum value. If not provided, the param will default to the first value of the enum.
-
DataClass
¶ alias of
builtins.object
-
blockSignals
(self, bool) → bool¶
-
childEvent
(self, QChildEvent)¶
-
children
(self) → List[QObject]¶
-
connectNotify
(self, QMetaMethod)¶
-
customEvent
(self, QEvent)¶
-
classmethod
defaultValue
(*args, **kwargs)¶
-
deleteLater
(self)¶
-
destroyed
¶ destroyed(self, object: QObject = None) [signal]
-
disconnect
(self)¶
-
disconnectNotify
(self, QMetaMethod)¶
-
dumpObjectInfo
(self)¶
-
dumpObjectTree
(self)¶
-
dynamicPropertyNames
(self) → List[QByteArray]¶
-
event
(self, QEvent) → bool¶
-
eventFilter
(self, QObject, QEvent) → bool¶
-
findChild
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject¶ findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
-
findChildren
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]¶ findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
-
classmethod
getParamSignal
(*args, **kwargs)¶
-
classmethod
getParamValue
(*args, **kwargs)¶
-
getTypeHint
()¶
-
inherits
(self, str) → bool¶
-
initAbstract
()¶
-
installEventFilter
(self, QObject)¶
-
classmethod
isAbstract
()¶ Whether the param is an “abstract” param.
-
isSignalConnected
(self, QMetaMethod) → bool¶
-
isWidgetType
(self) → bool¶
-
isWindowType
(self) → bool¶
-
killTimer
(self, int)¶
-
metaObject
(self) → QMetaObject¶
-
moveToThread
(self, QThread)¶
-
objectName
(self) → str¶
-
objectNameChanged
¶ objectNameChanged(self, str) [signal]
-
classmethod
owner
()¶ Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
-
classmethod
ownerChain
()¶ Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
-
classmethod
paramName
()¶ Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
-
parent
(self) → QObject¶
-
property
(self, str) → Any¶
-
pyqtConfigure
(...)¶ Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
-
receivers
(self, PYQT_SIGNAL) → int¶
-
removeEventFilter
(self, QObject)¶
-
sender
(self) → QObject¶
-
senderSignalIndex
(self) → int¶
-
setObjectName
(self, str)¶
-
classmethod
setParamValue
(*args, **kwargs)¶
-
setParent
(self, QObject)¶
-
setProperty
(self, str, Any) → bool¶
-
signalsBlocked
(self) → bool¶
-
startTimer
(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int¶
-
staticMetaObject
= <PyQt5.QtCore.QMetaObject object>¶
-
thread
(self) → QThread¶
-
timerEvent
(self, QTimerEvent)¶
-
tr
(self, str, disambiguation: str = None, n: int = -1) → str¶
-
-
class
schrodinger.tasks.jobtasks.
JobConfig
(default_value=<object object>, _param_type=<object object>, **kwargs)¶ Bases:
schrodinger.models.parameters.CompoundParam
Subclass JobConfig to customize what job settings are available for a given jobtask. To disable an option, set an ordinary (non-param) class variable with value None for that option.
Subclasses may add any arbitrary options as desired; it is the responsibility of the task to handle those options.
-
viewname
¶ Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
-
jobname
¶ Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
-
host_settings
¶
-
incorporation
= None¶
-
DataClass
¶ This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
-
__init__
(default_value=<object object>, _param_type=<object object>, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
addSubParam
(name, param, update_owner=True)¶
-
blockSignals
(self, bool) → bool¶
-
block_signal_propagation
()¶
-
childEvent
(self, QChildEvent)¶
-
children
(self) → List[QObject]¶
-
classmethod
configureParam
()¶ Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
-
connectNotify
(self, QMetaMethod)¶
-
customEvent
(self, QEvent)¶
-
classmethod
defaultValue
(*args, **kwargs)¶
-
deleteLater
(self)¶
-
destroyed
¶ destroyed(self, object: QObject = None) [signal]
-
disconnect
(self)¶
-
disconnectNotify
(self, QMetaMethod)¶
-
dumpObjectInfo
(self)¶
-
dumpObjectTree
(self)¶
-
dynamicPropertyNames
(self) → List[QByteArray]¶
-
event
(self, QEvent) → bool¶
-
eventFilter
(self, QObject, QEvent) → bool¶
-
findChild
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject¶ findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
-
findChildren
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]¶ findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
-
classmethod
fromJson
(json_obj)¶ A factory method which constructs a new object from a given dict loaded from a json string or file.
Parameters: json_obj (dict) – A json-loaded dictionary to create an object from. Returns: An instance of this class. :rtype : cls
-
classmethod
fromJsonImplementation
(json_dict)¶ Sets the value of this compound param value object from a JSON dict.
-
getAbstractParam
(*args, **kwargs)¶
-
classmethod
getJsonBlacklist
()¶ Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
- Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
-
classmethod
getParamSignal
(*args, **kwargs)¶
-
classmethod
getParamValue
(*args, **kwargs)¶
-
classmethod
getSubParam
(name)¶ Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to accss params is generally discouraged, but can be useful for serializing/deserializing param data.
Parameters: name (str) – The name of the subparam to get the value for.
-
classmethod
getSubParams
()¶ Return a dictionary mapping subparam names to their values.
-
getTypeHint
()¶
-
get_version
()¶ Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
-
host_settingsChanged
¶
-
host_settingsReplaced
¶
-
inherits
(self, str) → bool¶
-
initAbstract
()¶
-
initConcrete
()¶ Override to customize initialization of concrete params.
-
initializeValue
()¶ Override to dynamically set up the default value of the param. Useful for default values that are determined at runtime. This is called any time the param is reset.
-
installEventFilter
(self, QObject)¶
-
classmethod
isAbstract
()¶ Whether the param is an “abstract” param.
-
isDefault
(*args, **kwargs)¶
-
isSignalConnected
(self, QMetaMethod) → bool¶
-
isWidgetType
(self) → bool¶
-
isWindowType
(self) → bool¶
-
jobnameChanged
¶
-
jobnameReplaced
¶
-
killTimer
(self, int)¶
-
metaObject
(self) → QMetaObject¶
-
moveToThread
(self, QThread)¶
-
objectName
(self) → str¶
-
objectNameChanged
¶ objectNameChanged(self, str) [signal]
-
classmethod
owner
()¶ Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
-
classmethod
ownerChain
()¶ Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
-
classmethod
paramName
()¶ Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
-
parent
(self) → QObject¶
-
property
(self, str) → Any¶
-
pyqtConfigure
(...)¶ Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
-
receivers
(self, PYQT_SIGNAL) → int¶
-
removeEventFilter
(self, QObject)¶
-
reset
(*args, **kwargs)¶
-
sender
(self) → QObject¶
-
senderSignalIndex
(self) → int¶
-
setObjectName
(self, str)¶
-
classmethod
setParamValue
(*args, **kwargs)¶
-
setParent
(self, QObject)¶
-
setProperty
(self, str, Any) → bool¶
-
classmethod
setReference
(param1, param2)¶ Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
Parameters: - param1 – The first abstract param to keep synced
- param2 – The second abstract param. After instantiation, this param will take on the value of param1.
-
setValue
(*args, **kwargs)¶
-
signalsBlocked
(self) → bool¶
-
skip_eq_check
()¶
-
startTimer
(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int¶
-
staticMetaObject
= <PyQt5.QtCore.QMetaObject object>¶
-
thread
(self) → QThread¶
-
timerEvent
(self, QTimerEvent)¶
-
toDict
(*args, **kwargs)¶
-
toJson
(_mark_version=True)¶ Create and returns a data structure made up of jsonable items.
Return type: An instance of one the classes from NATIVE_JSON_DATATYPES
-
toJsonImplementation
(*args, **kwargs)¶
-
tr
(self, str, disambiguation: str = None, n: int = -1) → str¶
-
valueChanged
¶
-
viewnameChanged
¶
-
viewnameReplaced
¶
-
-
schrodinger.tasks.jobtasks.
job_config_factory
(allowed_host_types=<AllowedHostTypes.CPU_ONLY: 1>, default_incorp_mode=None, supports_subjobs=False, viewname=None)¶ Generate JobConfig objects with typical options.
Parameters: - allowed_host_types (AllowedHostTypes or None) – Whether this job accepts cpu hosts, gpu hosts, or both. Pass None to disable remote hosts (always run on localhost)
- default_incorp_mode (IncorporationMode or None) – The default disposition. Pass None for jobs that do not incorporate at all.
- supports_subjobs (bool) – whether this job can be split into subjobs
- viewname (str or None) – what viewname should be used for this type of job
-
class
schrodinger.tasks.jobtasks.
JobBackendCmdMixin
(*args, cmd_list=None, **kwargs)¶ Bases:
schrodinger.tasks.jobtasks._AbstractJobMixin
Base class for running backends that already support job control. Combine with an AbstractCmdTask. To use, override
makeCmd
.-
__init__
(*args, cmd_list=None, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
makeCmd
()¶ @overrides: tasks.AbstractCmdTask
Child classes must override.
-
PROGRAM_NAME
¶
-
classmethod
configToJobConfigAdapter
(json_dict)¶
-
classmethod
configureParam
()¶ @overrides: parameters.CompoundParam
-
inWriteMode
()¶
-
initializeValue
()¶ @overrides: paramters.CompoundParam
-
job_id
¶ This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
-
kill
()¶ @overrides: tasks.AbstractTask
-
replicate
()¶ @overrides: tasks.AbstractTask
-
runCmd
(cmd)¶ @overrides: tasks.AbstractCmdTask
-
classmethod
runFromCmdLine
()¶ @overrides: tasks.AbstractTask
-
write
(skip_preprocessing=False)¶
-
writeStuZipFile
()¶
-
-
class
schrodinger.tasks.jobtasks.
ComboJobMixin
(*args, **kwargs)¶ Bases:
schrodinger.tasks.jobtasks._LaunchAPIMixin
Base class for running python code using the “combo” task pattern. Combine with AbstractComboTask. To use, define:
mainFunction (or, equivalently backendMain): the python function that will be executed in the backend process under job control.-
write
(skip_preprocessing=False)¶
-
makeCmd
()¶ @overrides: tasks.AbstractCmdTask
Child classes must not override this method.
-
isBackendMode
()¶
-
runBackend
()¶ @overrides: AbstractComboTask
-
PROGRAM_NAME
¶
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
addInputDirectory
(directory)¶ Add an input directory to be copied over with the job.
-
addInputFile
(filename)¶ Register the given file with job control as an input file, so that it gets copied to the job directory when the task starts.
Parameters: filename (str) – Input file path.
-
addLicenseReservation
(license, num_tokens=1)¶ Add a license reservation for this job. This information is used by job control to ensure the job is only started once the required licenses become available.
In a preprocessor, (i.e. before launching the backend), a reservation should be added for each license that will be checked out directly by that backend. Example:
class GlideTask(ComboJobTask): @preprocessor def _reserveGlideLicense(self): # Reserve a Glide license. self.addLicenseReservation(license.GLIDE_MAIN) def mainFunction(self): # Check out the Glide license lic = license.License(license.GLIDE_MAIN) # ... Do computations requiring Glide ... lic.checkin()
Licenses that will be checked out by subjobs of this job do not need reservations added here; subjobs are responsible for their own license reservations.
Parameters: - license (module-constant from schrodinger.utils.license (e.g. license.AUTODESIGNER)) – a license that will be used by the backend
- num_tokens (int) – number of tokens for this license reservations
-
addOutputFile
(filename)¶ Register the given file with job control as an output file, so that it gets copied to the launch directory after the tasks completes.
Parameters: filename (str) – Input file path.
-
classmethod
configToJobConfigAdapter
(json_dict)¶
-
classmethod
configureParam
()¶ @overrides: parameters.CompoundParam
-
getLogAsString
()¶
-
inWriteMode
()¶
-
initConcrete
()¶
-
initializeValue
()¶ @overrides: paramters.CompoundParam
-
job_id
¶ This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
-
kill
()¶ @overrides: tasks.AbstractTask
-
makeJobSpecFromCmd
(cmd)¶
-
makeLaunchParams
()¶
-
replicate
()¶ @overrides: tasks.AbstractTask
-
runCmd
(cmd)¶ @overrides: tasks.AbstractCmdTask
-
classmethod
runFromCmdLine
()¶ @overrides: tasks.AbstractTask
-
wrapCmdInLaunchApi
(cmd)¶
-
writeStuZipFile
()¶
-
-
class
schrodinger.tasks.jobtasks.
CmdJobTask
(*args, cmd_list=None, **kwargs)¶ Bases:
schrodinger.tasks.jobtasks.JobBackendCmdMixin
,schrodinger.tasks.tasks.AbstractCmdTask
Class for running backends that already support jobcontrol.
CmdJobTask can either be subclassed to implement custom input/output params and other behavior, or can be instantiated and run directly by supplying the optional cmd_list constructor argument. For example:
task = jobtasks.CmdJobTask(cmd_list=[‘testapp’, ‘-t’, ‘1’]) task.start()Note that specifying cmd_list will bypass some custom functionality and should not be used with CmdJobTask subclasses.
-
AUTO_TASKDIR
= <object object>¶
-
CMDLINE
= 1¶
-
DEFAULT_TASKDIR_SETTING
= None¶
-
DONE
= 3¶
-
DataClass
¶ This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
-
FAILED
= 2¶
-
GUI
= 2¶
-
INTERRUPT_ENABLED
= False¶
-
PROGRAM_NAME
¶
-
RUNNING
= 1¶
-
TEMP_TASKDIR
= <object object>¶
-
WAITING
= 0¶
-
__init__
(*args, cmd_list=None, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
addFuncToGroup
(func, group=None, order=None)¶ Adds a function to the specified chain. Typically used for adding functions that are not methods of this object.
The function may optionally be decorated with a FuncGroupMarker. If so, the default group and order will be determined by the decorator. Any group or order explicitly passed in to addFuncToGroup will take precedence over the decorator settings.
Parameters: - func – the function to add
- group (FuncGroupMarker or None) – the group marker. If the function is decorated with a FuncGoupMarker, that group marker will be the default.
- order (float or None) – the sorting order. If the function is decorated with a FuncGoupMarker, the order specified in the decorator will be the default.
-
addPostprocessor
(func, order=0)¶ Adds a postproceessor function to this task instance. If the function has been decorated with
@postprocessor
, the order specified by the decorator will be used.Parameters: - func (typing.Callable) – the function to add
- order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
-
addPreprocessor
(func, order=None)¶ Adds a preproceessor function to this task instance. If the function has been decorated with @preprocessor, the order specified by the decorator will be used as the default.
Parameters: - func – the function to add
- order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
-
classmethod
addSubParam
(name, param, update_owner=True)¶
-
blockSignals
(self, bool) → bool¶
-
block_signal_propagation
()¶
-
calling_context
¶ This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
-
childEvent
(self, QChildEvent)¶
-
children
(self) → List[QObject]¶
-
classmethod
configToJobConfigAdapter
(json_dict)¶
-
classmethod
configureParam
()¶ @overrides: parameters.CompoundParam
-
connectNotify
(self, QMetaMethod)¶
-
customEvent
(self, QEvent)¶
-
classmethod
defaultValue
(*args, **kwargs)¶
-
deleteLater
(self)¶
-
destroyed
¶ destroyed(self, object: QObject = None) [signal]
-
disconnect
(self)¶
-
disconnectNotify
(self, QMetaMethod)¶
-
dumpObjectInfo
(self)¶
-
dumpObjectTree
(self)¶
-
dynamicPropertyNames
(self) → List[QByteArray]¶
-
event
(self, QEvent) → bool¶
-
eventFilter
(self, QObject, QEvent) → bool¶
-
failure_info
¶ This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
-
findChild
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject¶ findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
-
findChildren
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]¶ findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
-
classmethod
fromJson
(json_obj)¶ A factory method which constructs a new object from a given dict loaded from a json string or file.
Parameters: json_obj (dict) – A json-loaded dictionary to create an object from. Returns: An instance of this class. :rtype : cls
-
classmethod
fromJsonFilename
(filename)¶
-
classmethod
fromJsonImplementation
(json_dict)¶ Sets the value of this compound param value object from a JSON dict.
-
getAbstractParam
(*args, **kwargs)¶
-
getAddedFuncs
(group=None)¶
-
getFuncGroup
(group=None)¶ Retrieve the functions belonging to the specified group.
Parameters: group (FuncGroupMarker) – the group marker Returns: the functions in the specified group, in order Return type: list
-
classmethod
getJsonBlacklist
()¶ Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
- Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
-
classmethod
getParamSignal
(*args, **kwargs)¶
-
classmethod
getParamValue
(*args, **kwargs)¶
-
classmethod
getSubParam
(name)¶ Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to accss params is generally discouraged, but can be useful for serializing/deserializing param data.
Parameters: name (str) – The name of the subparam to get the value for.
-
classmethod
getSubParams
()¶ Return a dictionary mapping subparam names to their values.
-
getTaskDir
()¶ Returns the full path of the task directory. This is only available if the task directory exists (after creation of the taskdir or, if no task dir is specified, any time).
-
getTaskFilename
(fname)¶ Return the appropriate absolute path for an input or output file in the taskdir.
-
getTypeHint
()¶
-
get_version
()¶ Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
-
guard
()¶ Context manager that saves any Exception raised inside
-
inWriteMode
()¶
-
inherits
(self, str) → bool¶
-
initAbstract
()¶
-
initConcrete
()¶ Override to customize initialization of concrete params.
-
initializeValue
()¶ @overrides: paramters.CompoundParam
-
input
¶
-
inputChanged
¶
-
inputReplaced
¶
-
installEventFilter
(self, QObject)¶
-
classmethod
isAbstract
()¶ Whether the param is an “abstract” param.
-
isDefault
(*args, **kwargs)¶
-
isInterruptionRequested
()¶
-
isRunning
()¶
-
isSignalConnected
(self, QMetaMethod) → bool¶
-
isStartable
()¶
-
isWidgetType
(self) → bool¶
-
isWindowType
(self) → bool¶
-
job_config
¶ Subclass JobConfig to customize what job settings are available for a given jobtask. To disable an option, set an ordinary (non-param) class variable with value None for that option.
Subclasses may add any arbitrary options as desired; it is the responsibility of the task to handle those options.
-
job_configChanged
¶
-
job_configReplaced
¶
-
job_id
¶ This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
-
kill
()¶ @overrides: tasks.AbstractTask
-
killTimer
(self, int)¶
-
makeCmd
()¶ @overrides: tasks.AbstractCmdTask
Child classes must override.
-
max_progress
¶
-
max_progressChanged
¶
-
max_progressReplaced
¶
-
metaObject
(self) → QMetaObject¶
-
moveToThread
(self, QThread)¶
-
name
¶
-
nameChanged
¶
-
nameReplaced
¶
-
objectName
(self) → str¶
-
objectNameChanged
¶ objectNameChanged(self, str) [signal]
-
output
¶
-
outputChanged
¶
-
outputReplaced
¶
-
classmethod
owner
()¶ Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
-
classmethod
ownerChain
()¶ Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
-
classmethod
paramName
()¶ Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
-
parent
(self) → QObject¶
-
postprocessors
()¶ Returns: A list of postprocessors, both decorated methods on the task and external functions that have been added via addPostprocessor()
Return type: list[typing.Callable]
-
preprocessors
()¶ Returns: A list of preprocessors (both decorated methods on the task and external functions that have been added via addPreprocessor)
-
processFuncChain
(chain=None, result_callback=None)¶ Execute each function in the specified chain sequentially in order.
The result_callback is called after each function with the return value of that function. This can be used to respond to the return value (e.g. present information to the user, get user feedback, log the result, etc.)
The return value of the result_callback determines whether processing will proceeed to the next function.
Parameters: - chain (FuncChainDecorator) – which chain to process
- result_callback – the callback that will get called with the result of each function in the chain
Returns: a list of the results from the functions
-
progress
¶
-
progressChanged
¶
-
progressReplaced
¶
-
property
(self, str) → Any¶
-
pyqtConfigure
(...)¶ Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
-
receivers
(self, PYQT_SIGNAL) → int¶
-
removeEventFilter
(self, QObject)¶
-
replicate
()¶ @overrides: tasks.AbstractTask
-
requestInterruption
()¶ Request the task to stop.
To enable this feature, subclasses should periodically check whether an interruption has been requested and terminate if it has been. If such logic has been included,
INTERRUPT_ENABLED
should be set toTrue
.
-
reset
(*args, **kwargs)¶
-
run
()¶
-
runCmd
(cmd)¶ @overrides: tasks.AbstractCmdTask
-
classmethod
runFromCmdLine
()¶ @overrides: tasks.AbstractTask
-
runPostprocessing
(callback=None)¶
-
runPreprocessing
(callback=None, calling_context=None)¶ Run the preprocessors one-by-one. By default, any failing preprocessor will raise a TaskFailure exception and terminate processing. This behavior may be customized by supplying a callback function which will be called after each preprocessor with the result of that preprocessor.
This method is “final” so that all preprocessing logic will be enclosed in the try/finally block.
Parameters: - callback – a function that takes result and returns a bool that indicates whether to continue on to the next preprocessor
- calling_context – specify a value here to indicate the context in which this preprocessing is being called. This value will be stored in an instance variable, self.calling_context, which can be accessed from any preprocessor method on this task. Typically this value will be either self.GUI, self.CMDLINE, or None, but any value may be supplied here and checked for in the preprocessor methods. self.calling_context always reverts back to None at the end of runPreprocessing.
-
sender
(self) → QObject¶
-
senderSignalIndex
(self) → int¶
-
setObjectName
(self, str)¶
-
classmethod
setParamValue
(*args, **kwargs)¶
-
setParent
(self, QObject)¶
-
setProperty
(self, str, Any) → bool¶
-
classmethod
setReference
(param1, param2)¶ Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
Parameters: - param1 – The first abstract param to keep synced
- param2 – The second abstract param. After instantiation, this param will take on the value of param1.
-
setValue
(*args, **kwargs)¶
-
signalsBlocked
(self) → bool¶
-
skip_eq_check
()¶
-
specifyTaskDir
(taskdir_spec)¶ Specify the taskdir creation behavior. Use one of the following options:
A directory name (string). This may be a relative or absolute path
None - no taskdir is requested. The task will use the CWD as its taskdir
AUTO_TASKDIR - a new subdirectory will be created in the CWD using the task name as the directory name.
TEMP_TASKDIR - a temporary directory will be created in the schrodinger temp dir. This directory is cleaned up when the task is deleted.
Parameters: taskdir_spec – one of the four options listed above
-
start
(skip_preprocessing=False)¶ This is the main method for starting a task. Start will check if a task is not already running, run preprocessing, and then run the task.
Failures in preprocessing will interrupt the task start, and the task will never enter the RUNNING state.
Parameters: skip_preprocessing (bool) – whether to skip preprocessing. This can be useful if preprocessing was already performed prior to calling start.
-
startTimer
(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int¶
-
staticMetaObject
= <PyQt5.QtCore.QMetaObject object>¶
-
status
¶
-
statusChanged
¶
-
statusReplaced
¶
-
taskDirSetting
()¶ Returns the taskdir spec. See specifyTaskDir() for details.
-
taskDone
¶
-
taskFailed
¶
-
taskStarted
¶
-
thread
(self) → QThread¶
-
timerEvent
(self, QTimerEvent)¶
-
toDict
(*args, **kwargs)¶
-
toJson
(_mark_version=True)¶ Create and returns a data structure made up of jsonable items.
Return type: An instance of one the classes from NATIVE_JSON_DATATYPES
-
toJsonImplementation
(*args, **kwargs)¶
-
tr
(self, str, disambiguation: str = None, n: int = -1) → str¶
-
valueChanged
¶
-
wait
(timeout=None)¶ Block until the task is finished executing or
timeout
seconds have passed.Parameters: timeout (NoneType or int) – Amount of time in seconds to wait before timing out. If None or a negative number, this method will wait until the task is finished.
-
write
(skip_preprocessing=False)¶
-
writeStuZipFile
()¶
-
-
class
schrodinger.tasks.jobtasks.
ComboJobTask
(*args, **kwargs)¶ Bases:
schrodinger.tasks.jobtasks.ComboJobMixin
,schrodinger.tasks.tasks.AbstractComboTask
-
runBackend
()¶ @overrides: AbstractComboTask
-
getTaskDir
()¶ Returns the full path of the task directory. This is only available if the task directory exists (after creation of the taskdir or, if no task dir is specified, any time).
-
AUTO_TASKDIR
= <object object>¶
-
CMDLINE
= 1¶
-
DEFAULT_TASKDIR_SETTING
= None¶
-
DONE
= 3¶
-
DataClass
¶ This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
-
ENTRYPOINT
= 'combotask_entry_point.py'¶
-
FAILED
= 2¶
-
GUI
= 2¶
-
INTERRUPT_ENABLED
= False¶
-
PROGRAM_NAME
¶
-
RUNNING
= 1¶
-
TEMP_TASKDIR
= <object object>¶
-
WAITING
= 0¶
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
addFuncToGroup
(func, group=None, order=None)¶ Adds a function to the specified chain. Typically used for adding functions that are not methods of this object.
The function may optionally be decorated with a FuncGroupMarker. If so, the default group and order will be determined by the decorator. Any group or order explicitly passed in to addFuncToGroup will take precedence over the decorator settings.
Parameters: - func – the function to add
- group (FuncGroupMarker or None) – the group marker. If the function is decorated with a FuncGoupMarker, that group marker will be the default.
- order (float or None) – the sorting order. If the function is decorated with a FuncGoupMarker, the order specified in the decorator will be the default.
-
addInputDirectory
(directory)¶ Add an input directory to be copied over with the job.
-
addInputFile
(filename)¶ Register the given file with job control as an input file, so that it gets copied to the job directory when the task starts.
Parameters: filename (str) – Input file path.
-
addLicenseReservation
(license, num_tokens=1)¶ Add a license reservation for this job. This information is used by job control to ensure the job is only started once the required licenses become available.
In a preprocessor, (i.e. before launching the backend), a reservation should be added for each license that will be checked out directly by that backend. Example:
class GlideTask(ComboJobTask): @preprocessor def _reserveGlideLicense(self): # Reserve a Glide license. self.addLicenseReservation(license.GLIDE_MAIN) def mainFunction(self): # Check out the Glide license lic = license.License(license.GLIDE_MAIN) # ... Do computations requiring Glide ... lic.checkin()
Licenses that will be checked out by subjobs of this job do not need reservations added here; subjobs are responsible for their own license reservations.
Parameters: - license (module-constant from schrodinger.utils.license (e.g. license.AUTODESIGNER)) – a license that will be used by the backend
- num_tokens (int) – number of tokens for this license reservations
-
addOutputFile
(filename)¶ Register the given file with job control as an output file, so that it gets copied to the launch directory after the tasks completes.
Parameters: filename (str) – Input file path.
-
addPostprocessor
(func, order=0)¶ Adds a postproceessor function to this task instance. If the function has been decorated with
@postprocessor
, the order specified by the decorator will be used.Parameters: - func (typing.Callable) – the function to add
- order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
-
addPreprocessor
(func, order=None)¶ Adds a preproceessor function to this task instance. If the function has been decorated with @preprocessor, the order specified by the decorator will be used as the default.
Parameters: - func – the function to add
- order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
-
classmethod
addSubParam
(name, param, update_owner=True)¶
-
backendMain
()¶
-
blockSignals
(self, bool) → bool¶
-
block_signal_propagation
()¶
-
calling_context
¶ This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
-
childEvent
(self, QChildEvent)¶
-
children
(self) → List[QObject]¶
-
classmethod
configToJobConfigAdapter
(json_dict)¶
-
classmethod
configureParam
()¶ @overrides: parameters.CompoundParam
-
connectNotify
(self, QMetaMethod)¶
-
customEvent
(self, QEvent)¶
-
classmethod
defaultValue
(*args, **kwargs)¶
-
deleteLater
(self)¶
-
destroyed
¶ destroyed(self, object: QObject = None) [signal]
-
disconnect
(self)¶
-
disconnectNotify
(self, QMetaMethod)¶
-
dumpObjectInfo
(self)¶
-
dumpObjectTree
(self)¶
-
dynamicPropertyNames
(self) → List[QByteArray]¶
-
event
(self, QEvent) → bool¶
-
eventFilter
(self, QObject, QEvent) → bool¶
-
failure_info
¶ This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
-
findChild
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject¶ findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
-
findChildren
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]¶ findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
-
classmethod
fromJson
(json_obj)¶ A factory method which constructs a new object from a given dict loaded from a json string or file.
Parameters: json_obj (dict) – A json-loaded dictionary to create an object from. Returns: An instance of this class. :rtype : cls
-
classmethod
fromJsonFilename
(filename)¶
-
classmethod
fromJsonImplementation
(json_dict)¶ Sets the value of this compound param value object from a JSON dict.
-
getAbstractParam
(*args, **kwargs)¶
-
getAddedFuncs
(group=None)¶
-
getFuncGroup
(group=None)¶ Retrieve the functions belonging to the specified group.
Parameters: group (FuncGroupMarker) – the group marker Returns: the functions in the specified group, in order Return type: list
-
classmethod
getJsonBlacklist
()¶ Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
- Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
-
getLogAsString
()¶
-
classmethod
getParamSignal
(*args, **kwargs)¶
-
classmethod
getParamValue
(*args, **kwargs)¶
-
classmethod
getSubParam
(name)¶ Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to accss params is generally discouraged, but can be useful for serializing/deserializing param data.
Parameters: name (str) – The name of the subparam to get the value for.
-
classmethod
getSubParams
()¶ Return a dictionary mapping subparam names to their values.
-
getTaskFilename
(fname)¶ Return the appropriate absolute path for an input or output file in the taskdir.
-
getTypeHint
()¶
-
get_version
()¶ Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
-
guard
()¶ Context manager that saves any Exception raised inside
-
inWriteMode
()¶
-
incorporation_file
¶ Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
-
incorporation_fileChanged
¶
-
incorporation_fileReplaced
¶
-
inherits
(self, str) → bool¶
-
initAbstract
()¶
-
initConcrete
()¶
-
initializeValue
()¶ @overrides: paramters.CompoundParam
-
input
¶
-
inputChanged
¶
-
inputReplaced
¶
-
input_files
¶ A Param to represent lists. Values of this param will have a
mutated
signal that will be emitted whenever any mutation method is called.The constructor optionally takes a
item_class
keyword argument to specify what type of class the items in the list will be. This information will be used for jsonifying the list if specified.
-
input_filesChanged
¶
-
input_filesReplaced
¶
-
installEventFilter
(self, QObject)¶
-
classmethod
isAbstract
()¶ Whether the param is an “abstract” param.
-
isBackendMode
()¶
-
isDefault
(*args, **kwargs)¶
-
isInterruptionRequested
()¶
-
isRunning
()¶
-
isSignalConnected
(self, QMetaMethod) → bool¶
-
isStartable
()¶
-
isWidgetType
(self) → bool¶
-
isWindowType
(self) → bool¶
-
job_config
¶ Subclass JobConfig to customize what job settings are available for a given jobtask. To disable an option, set an ordinary (non-param) class variable with value None for that option.
Subclasses may add any arbitrary options as desired; it is the responsibility of the task to handle those options.
-
job_configChanged
¶
-
job_configReplaced
¶
-
job_id
¶ This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
-
json_filename
¶
-
json_out_filename
¶
-
kill
()¶ @overrides: tasks.AbstractTask
-
killTimer
(self, int)¶
-
mainFunction
()¶
-
makeCmd
()¶ @overrides: tasks.AbstractCmdTask
Child classes must not override this method.
-
makeJobSpecFromCmd
(cmd)¶
-
makeLaunchParams
()¶
-
max_progress
¶
-
max_progressChanged
¶
-
max_progressReplaced
¶
-
metaObject
(self) → QMetaObject¶
-
moveToThread
(self, QThread)¶
-
name
¶
-
nameChanged
¶
-
nameReplaced
¶
-
objectName
(self) → str¶
-
objectNameChanged
¶ objectNameChanged(self, str) [signal]
-
output
¶
-
outputChanged
¶
-
outputReplaced
¶
-
output_files
¶ A Param to represent lists. Values of this param will have a
mutated
signal that will be emitted whenever any mutation method is called.The constructor optionally takes a
item_class
keyword argument to specify what type of class the items in the list will be. This information will be used for jsonifying the list if specified.
-
output_filesChanged
¶
-
output_filesReplaced
¶
-
classmethod
owner
()¶ Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
-
classmethod
ownerChain
()¶ Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
-
classmethod
paramName
()¶ Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
-
parent
(self) → QObject¶
-
postprocessors
()¶ Returns: A list of postprocessors, both decorated methods on the task and external functions that have been added via addPostprocessor()
Return type: list[typing.Callable]
-
preprocessors
()¶ Returns: A list of preprocessors (both decorated methods on the task and external functions that have been added via addPreprocessor)
-
processFuncChain
(chain=None, result_callback=None)¶ Execute each function in the specified chain sequentially in order.
The result_callback is called after each function with the return value of that function. This can be used to respond to the return value (e.g. present information to the user, get user feedback, log the result, etc.)
The return value of the result_callback determines whether processing will proceeed to the next function.
Parameters: - chain (FuncChainDecorator) – which chain to process
- result_callback – the callback that will get called with the result of each function in the chain
Returns: a list of the results from the functions
-
progress
¶
-
progressChanged
¶
-
progressReplaced
¶
-
property
(self, str) → Any¶
-
pyqtConfigure
(...)¶ Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
-
receivers
(self, PYQT_SIGNAL) → int¶
-
removeEventFilter
(self, QObject)¶
-
replicate
()¶ @overrides: tasks.AbstractTask
-
requestInterruption
()¶ Request the task to stop.
To enable this feature, subclasses should periodically check whether an interruption has been requested and terminate if it has been. If such logic has been included,
INTERRUPT_ENABLED
should be set toTrue
.
-
reset
(*args, **kwargs)¶
-
run
()¶
-
runCmd
(cmd)¶ @overrides: tasks.AbstractCmdTask
-
classmethod
runFromCmdLine
()¶ @overrides: tasks.AbstractTask
-
runPostprocessing
(callback=None)¶
-
runPreprocessing
(callback=None, calling_context=None)¶ Run the preprocessors one-by-one. By default, any failing preprocessor will raise a TaskFailure exception and terminate processing. This behavior may be customized by supplying a callback function which will be called after each preprocessor with the result of that preprocessor.
This method is “final” so that all preprocessing logic will be enclosed in the try/finally block.
Parameters: - callback – a function that takes result and returns a bool that indicates whether to continue on to the next preprocessor
- calling_context – specify a value here to indicate the context in which this preprocessing is being called. This value will be stored in an instance variable, self.calling_context, which can be accessed from any preprocessor method on this task. Typically this value will be either self.GUI, self.CMDLINE, or None, but any value may be supplied here and checked for in the preprocessor methods. self.calling_context always reverts back to None at the end of runPreprocessing.
-
sender
(self) → QObject¶
-
senderSignalIndex
(self) → int¶
-
setObjectName
(self, str)¶
-
classmethod
setParamValue
(*args, **kwargs)¶
-
setParent
(self, QObject)¶
-
setProperty
(self, str, Any) → bool¶
-
classmethod
setReference
(param1, param2)¶ Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
Parameters: - param1 – The first abstract param to keep synced
- param2 – The second abstract param. After instantiation, this param will take on the value of param1.
-
setValue
(*args, **kwargs)¶
-
signalsBlocked
(self) → bool¶
-
skip_eq_check
()¶
-
specifyTaskDir
(taskdir_spec)¶ Specify the taskdir creation behavior. Use one of the following options:
A directory name (string). This may be a relative or absolute path
None - no taskdir is requested. The task will use the CWD as its taskdir
AUTO_TASKDIR - a new subdirectory will be created in the CWD using the task name as the directory name.
TEMP_TASKDIR - a temporary directory will be created in the schrodinger temp dir. This directory is cleaned up when the task is deleted.
Parameters: taskdir_spec – one of the four options listed above
-
start
(*args, **kwargs)¶ @overrides: AbstractTask
-
startTimer
(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int¶
-
staticMetaObject
= <PyQt5.QtCore.QMetaObject object>¶
-
status
¶
-
statusChanged
¶
-
statusReplaced
¶
-
taskDirSetting
()¶ Returns the taskdir spec. See specifyTaskDir() for details.
-
taskDone
¶
-
taskFailed
¶
-
taskStarted
¶
-
thread
(self) → QThread¶
-
timerEvent
(self, QTimerEvent)¶
-
toDict
(*args, **kwargs)¶
-
toJson
(_mark_version=True)¶ Create and returns a data structure made up of jsonable items.
Return type: An instance of one the classes from NATIVE_JSON_DATATYPES
-
toJsonImplementation
(*args, **kwargs)¶
-
tr
(self, str, disambiguation: str = None, n: int = -1) → str¶
-
valueChanged
¶
-
wait
(timeout=None)¶ Block until the task is finished executing or
timeout
seconds have passed.Parameters: timeout (NoneType or int) – Amount of time in seconds to wait before timing out. If None or a negative number, this method will wait until the task is finished.
-
wrapCmdInLaunchApi
(cmd)¶
-
write
(skip_preprocessing=False)¶
-
writeJsonFile
(filename)¶
-
writeStuZipFile
()¶
-
-
class
schrodinger.tasks.jobtasks.
TestJobTask
(*args, **kwargs)¶ Bases:
schrodinger.tasks.jobtasks.ComboJobTask
For use with unit tests.
-
class
Input
(default_value=<object object>, _param_type=<object object>, **kwargs)¶ Bases:
schrodinger.models.parameters.CompoundParam
-
final_progress
¶ Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
-
final_max_progress
¶ Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
-
delay
¶ Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
-
DataClass
¶ This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
-
__init__
(default_value=<object object>, _param_type=<object object>, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
addSubParam
(name, param, update_owner=True)¶
-
blockSignals
(self, bool) → bool¶
-
block_signal_propagation
()¶
-
childEvent
(self, QChildEvent)¶
-
children
(self) → List[QObject]¶
-
classmethod
configureParam
()¶ Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
-
connectNotify
(self, QMetaMethod)¶
-
customEvent
(self, QEvent)¶
-
classmethod
defaultValue
(*args, **kwargs)¶
-
delayChanged
¶
-
delayReplaced
¶
-
deleteLater
(self)¶
-
destroyed
¶ destroyed(self, object: QObject = None) [signal]
-
disconnect
(self)¶
-
disconnectNotify
(self, QMetaMethod)¶
-
dumpObjectInfo
(self)¶
-
dumpObjectTree
(self)¶
-
dynamicPropertyNames
(self) → List[QByteArray]¶
-
event
(self, QEvent) → bool¶
-
eventFilter
(self, QObject, QEvent) → bool¶
-
final_max_progressChanged
¶
-
final_max_progressReplaced
¶
-
final_progressChanged
¶
-
final_progressReplaced
¶
-
findChild
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject¶ findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
-
findChildren
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]¶ findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
-
classmethod
fromJson
(json_obj)¶ A factory method which constructs a new object from a given dict loaded from a json string or file.
Parameters: json_obj (dict) – A json-loaded dictionary to create an object from. Returns: An instance of this class. :rtype : cls
-
classmethod
fromJsonImplementation
(json_dict)¶ Sets the value of this compound param value object from a JSON dict.
-
getAbstractParam
(*args, **kwargs)¶
-
classmethod
getJsonBlacklist
()¶ Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
- Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
-
classmethod
getParamSignal
(*args, **kwargs)¶
-
classmethod
getParamValue
(*args, **kwargs)¶
-
classmethod
getSubParam
(name)¶ Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to accss params is generally discouraged, but can be useful for serializing/deserializing param data.
Parameters: name (str) – The name of the subparam to get the value for.
-
classmethod
getSubParams
()¶ Return a dictionary mapping subparam names to their values.
-
getTypeHint
()¶
-
get_version
()¶ Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
-
inherits
(self, str) → bool¶
-
initAbstract
()¶
-
initConcrete
()¶ Override to customize initialization of concrete params.
-
initializeValue
()¶ Override to dynamically set up the default value of the param. Useful for default values that are determined at runtime. This is called any time the param is reset.
-
installEventFilter
(self, QObject)¶
-
classmethod
isAbstract
()¶ Whether the param is an “abstract” param.
-
isDefault
(*args, **kwargs)¶
-
isSignalConnected
(self, QMetaMethod) → bool¶
-
isWidgetType
(self) → bool¶
-
isWindowType
(self) → bool¶
-
killTimer
(self, int)¶
-
metaObject
(self) → QMetaObject¶
-
moveToThread
(self, QThread)¶
-
objectName
(self) → str¶
-
objectNameChanged
¶ objectNameChanged(self, str) [signal]
-
classmethod
owner
()¶ Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
-
classmethod
ownerChain
()¶ Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
-
classmethod
paramName
()¶ Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
-
parent
(self) → QObject¶
-
property
(self, str) → Any¶
-
pyqtConfigure
(...)¶ Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
-
receivers
(self, PYQT_SIGNAL) → int¶
-
removeEventFilter
(self, QObject)¶
-
reset
(*args, **kwargs)¶
-
sender
(self) → QObject¶
-
senderSignalIndex
(self) → int¶
-
setObjectName
(self, str)¶
-
classmethod
setParamValue
(*args, **kwargs)¶
-
setParent
(self, QObject)¶
-
setProperty
(self, str, Any) → bool¶
-
classmethod
setReference
(param1, param2)¶ Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
Parameters: - param1 – The first abstract param to keep synced
- param2 – The second abstract param. After instantiation, this param will take on the value of param1.
-
setValue
(*args, **kwargs)¶
-
signalsBlocked
(self) → bool¶
-
skip_eq_check
()¶
-
startTimer
(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int¶
-
staticMetaObject
= <PyQt5.QtCore.QMetaObject object>¶
-
thread
(self) → QThread¶
-
timerEvent
(self, QTimerEvent)¶
-
toDict
(*args, **kwargs)¶
-
toJson
(_mark_version=True)¶ Create and returns a data structure made up of jsonable items.
Return type: An instance of one the classes from NATIVE_JSON_DATATYPES
-
toJsonImplementation
(*args, **kwargs)¶
-
tr
(self, str, disambiguation: str = None, n: int = -1) → str¶
-
valueChanged
¶
-
-
AUTO_TASKDIR
= <object object>¶
-
CMDLINE
= 1¶
-
DEFAULT_TASKDIR_SETTING
= None¶
-
DONE
= 3¶
-
DataClass
¶ This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
-
ENTRYPOINT
= 'combotask_entry_point.py'¶
-
FAILED
= 2¶
-
GUI
= 2¶
-
INTERRUPT_ENABLED
= False¶
-
PROGRAM_NAME
¶
-
RUNNING
= 1¶
-
TEMP_TASKDIR
= <object object>¶
-
WAITING
= 0¶
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
addFuncToGroup
(func, group=None, order=None)¶ Adds a function to the specified chain. Typically used for adding functions that are not methods of this object.
The function may optionally be decorated with a FuncGroupMarker. If so, the default group and order will be determined by the decorator. Any group or order explicitly passed in to addFuncToGroup will take precedence over the decorator settings.
Parameters: - func – the function to add
- group (FuncGroupMarker or None) – the group marker. If the function is decorated with a FuncGoupMarker, that group marker will be the default.
- order (float or None) – the sorting order. If the function is decorated with a FuncGoupMarker, the order specified in the decorator will be the default.
-
addInputDirectory
(directory)¶ Add an input directory to be copied over with the job.
-
addInputFile
(filename)¶ Register the given file with job control as an input file, so that it gets copied to the job directory when the task starts.
Parameters: filename (str) – Input file path.
-
addLicenseReservation
(license, num_tokens=1)¶ Add a license reservation for this job. This information is used by job control to ensure the job is only started once the required licenses become available.
In a preprocessor, (i.e. before launching the backend), a reservation should be added for each license that will be checked out directly by that backend. Example:
class GlideTask(ComboJobTask): @preprocessor def _reserveGlideLicense(self): # Reserve a Glide license. self.addLicenseReservation(license.GLIDE_MAIN) def mainFunction(self): # Check out the Glide license lic = license.License(license.GLIDE_MAIN) # ... Do computations requiring Glide ... lic.checkin()
Licenses that will be checked out by subjobs of this job do not need reservations added here; subjobs are responsible for their own license reservations.
Parameters: - license (module-constant from schrodinger.utils.license (e.g. license.AUTODESIGNER)) – a license that will be used by the backend
- num_tokens (int) – number of tokens for this license reservations
-
addOutputFile
(filename)¶ Register the given file with job control as an output file, so that it gets copied to the launch directory after the tasks completes.
Parameters: filename (str) – Input file path.
-
addPostprocessor
(func, order=0)¶ Adds a postproceessor function to this task instance. If the function has been decorated with
@postprocessor
, the order specified by the decorator will be used.Parameters: - func (typing.Callable) – the function to add
- order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
-
addPreprocessor
(func, order=None)¶ Adds a preproceessor function to this task instance. If the function has been decorated with @preprocessor, the order specified by the decorator will be used as the default.
Parameters: - func – the function to add
- order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
-
classmethod
addSubParam
(name, param, update_owner=True)¶
-
backendMain
()¶
-
blockSignals
(self, bool) → bool¶
-
block_signal_propagation
()¶
-
calling_context
¶ This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
-
childEvent
(self, QChildEvent)¶
-
children
(self) → List[QObject]¶
-
classmethod
configToJobConfigAdapter
(json_dict)¶
-
classmethod
configureParam
()¶ @overrides: parameters.CompoundParam
-
connectNotify
(self, QMetaMethod)¶
-
customEvent
(self, QEvent)¶
-
classmethod
defaultValue
(*args, **kwargs)¶
-
deleteLater
(self)¶
-
destroyed
¶ destroyed(self, object: QObject = None) [signal]
-
disconnect
(self)¶
-
disconnectNotify
(self, QMetaMethod)¶
-
dumpObjectInfo
(self)¶
-
dumpObjectTree
(self)¶
-
dynamicPropertyNames
(self) → List[QByteArray]¶
-
event
(self, QEvent) → bool¶
-
eventFilter
(self, QObject, QEvent) → bool¶
-
failure_info
¶ This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
-
findChild
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject¶ findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
-
findChildren
(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]¶ findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
-
classmethod
fromJson
(json_obj)¶ A factory method which constructs a new object from a given dict loaded from a json string or file.
Parameters: json_obj (dict) – A json-loaded dictionary to create an object from. Returns: An instance of this class. :rtype : cls
-
classmethod
fromJsonFilename
(filename)¶
-
classmethod
fromJsonImplementation
(json_dict)¶ Sets the value of this compound param value object from a JSON dict.
-
getAbstractParam
(*args, **kwargs)¶
-
getAddedFuncs
(group=None)¶
-
getFuncGroup
(group=None)¶ Retrieve the functions belonging to the specified group.
Parameters: group (FuncGroupMarker) – the group marker Returns: the functions in the specified group, in order Return type: list
-
classmethod
getJsonBlacklist
()¶ Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
- Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
-
getLogAsString
()¶
-
classmethod
getParamSignal
(*args, **kwargs)¶
-
classmethod
getParamValue
(*args, **kwargs)¶
-
classmethod
getSubParam
(name)¶ Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to accss params is generally discouraged, but can be useful for serializing/deserializing param data.
Parameters: name (str) – The name of the subparam to get the value for.
-
classmethod
getSubParams
()¶ Return a dictionary mapping subparam names to their values.
-
getTaskDir
()¶ Returns the full path of the task directory. This is only available if the task directory exists (after creation of the taskdir or, if no task dir is specified, any time).
-
getTaskFilename
(fname)¶ Return the appropriate absolute path for an input or output file in the taskdir.
-
getTypeHint
()¶
-
get_version
()¶ Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
-
guard
()¶ Context manager that saves any Exception raised inside
-
inWriteMode
()¶
-
incorporation_file
¶ Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
-
incorporation_fileChanged
¶
-
incorporation_fileReplaced
¶
-
inherits
(self, str) → bool¶
-
initAbstract
()¶
-
initConcrete
()¶
-
initializeValue
()¶ @overrides: paramters.CompoundParam
-
input
¶
-
inputChanged
¶
-
inputReplaced
¶
-
input_files
¶ A Param to represent lists. Values of this param will have a
mutated
signal that will be emitted whenever any mutation method is called.The constructor optionally takes a
item_class
keyword argument to specify what type of class the items in the list will be. This information will be used for jsonifying the list if specified.
-
input_filesChanged
¶
-
input_filesReplaced
¶
-
installEventFilter
(self, QObject)¶
-
classmethod
isAbstract
()¶ Whether the param is an “abstract” param.
-
isBackendMode
()¶
-
isDefault
(*args, **kwargs)¶
-
isInterruptionRequested
()¶
-
isRunning
()¶
-
isSignalConnected
(self, QMetaMethod) → bool¶
-
isStartable
()¶
-
isWidgetType
(self) → bool¶
-
isWindowType
(self) → bool¶
-
job_config
¶ Subclass JobConfig to customize what job settings are available for a given jobtask. To disable an option, set an ordinary (non-param) class variable with value None for that option.
Subclasses may add any arbitrary options as desired; it is the responsibility of the task to handle those options.
-
job_configChanged
¶
-
job_configReplaced
¶
-
job_id
¶ This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
-
json_filename
¶
-
json_out_filename
¶
-
kill
()¶ @overrides: tasks.AbstractTask
-
killTimer
(self, int)¶
-
mainFunction
()¶
-
makeCmd
()¶ @overrides: tasks.AbstractCmdTask
Child classes must not override this method.
-
makeJobSpecFromCmd
(cmd)¶
-
makeLaunchParams
()¶
-
max_progress
¶
-
max_progressChanged
¶
-
max_progressReplaced
¶
-
metaObject
(self) → QMetaObject¶
-
moveToThread
(self, QThread)¶
-
name
¶
-
nameChanged
¶
-
nameReplaced
¶
-
objectName
(self) → str¶
-
objectNameChanged
¶ objectNameChanged(self, str) [signal]
-
output
¶
-
outputChanged
¶
-
outputReplaced
¶
-
output_files
¶ A Param to represent lists. Values of this param will have a
mutated
signal that will be emitted whenever any mutation method is called.The constructor optionally takes a
item_class
keyword argument to specify what type of class the items in the list will be. This information will be used for jsonifying the list if specified.
-
output_filesChanged
¶
-
output_filesReplaced
¶
-
classmethod
owner
()¶ Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
-
classmethod
ownerChain
()¶ Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
-
classmethod
paramName
()¶ Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
-
parent
(self) → QObject¶
-
postprocessors
()¶ Returns: A list of postprocessors, both decorated methods on the task and external functions that have been added via addPostprocessor()
Return type: list[typing.Callable]
-
preprocessors
()¶ Returns: A list of preprocessors (both decorated methods on the task and external functions that have been added via addPreprocessor)
-
processFuncChain
(chain=None, result_callback=None)¶ Execute each function in the specified chain sequentially in order.
The result_callback is called after each function with the return value of that function. This can be used to respond to the return value (e.g. present information to the user, get user feedback, log the result, etc.)
The return value of the result_callback determines whether processing will proceeed to the next function.
Parameters: - chain (FuncChainDecorator) – which chain to process
- result_callback – the callback that will get called with the result of each function in the chain
Returns: a list of the results from the functions
-
progress
¶
-
progressChanged
¶
-
progressReplaced
¶
-
property
(self, str) → Any¶
-
pyqtConfigure
(...)¶ Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
-
receivers
(self, PYQT_SIGNAL) → int¶
-
removeEventFilter
(self, QObject)¶
-
replicate
()¶ @overrides: tasks.AbstractTask
-
requestInterruption
()¶ Request the task to stop.
To enable this feature, subclasses should periodically check whether an interruption has been requested and terminate if it has been. If such logic has been included,
INTERRUPT_ENABLED
should be set toTrue
.
-
reset
(*args, **kwargs)¶
-
run
()¶
-
runBackend
()¶ @overrides: AbstractComboTask
-
runCmd
(cmd)¶ @overrides: tasks.AbstractCmdTask
-
classmethod
runFromCmdLine
()¶ @overrides: tasks.AbstractTask
-
runPostprocessing
(callback=None)¶
-
runPreprocessing
(callback=None, calling_context=None)¶ Run the preprocessors one-by-one. By default, any failing preprocessor will raise a TaskFailure exception and terminate processing. This behavior may be customized by supplying a callback function which will be called after each preprocessor with the result of that preprocessor.
This method is “final” so that all preprocessing logic will be enclosed in the try/finally block.
Parameters: - callback – a function that takes result and returns a bool that indicates whether to continue on to the next preprocessor
- calling_context – specify a value here to indicate the context in which this preprocessing is being called. This value will be stored in an instance variable, self.calling_context, which can be accessed from any preprocessor method on this task. Typically this value will be either self.GUI, self.CMDLINE, or None, but any value may be supplied here and checked for in the preprocessor methods. self.calling_context always reverts back to None at the end of runPreprocessing.
-
sender
(self) → QObject¶
-
senderSignalIndex
(self) → int¶
-
setObjectName
(self, str)¶
-
classmethod
setParamValue
(*args, **kwargs)¶
-
setParent
(self, QObject)¶
-
setProperty
(self, str, Any) → bool¶
-
classmethod
setReference
(param1, param2)¶ Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
Parameters: - param1 – The first abstract param to keep synced
- param2 – The second abstract param. After instantiation, this param will take on the value of param1.
-
setValue
(*args, **kwargs)¶
-
signalsBlocked
(self) → bool¶
-
skip_eq_check
()¶
-
specifyTaskDir
(taskdir_spec)¶ Specify the taskdir creation behavior. Use one of the following options:
A directory name (string). This may be a relative or absolute path
None - no taskdir is requested. The task will use the CWD as its taskdir
AUTO_TASKDIR - a new subdirectory will be created in the CWD using the task name as the directory name.
TEMP_TASKDIR - a temporary directory will be created in the schrodinger temp dir. This directory is cleaned up when the task is deleted.
Parameters: taskdir_spec – one of the four options listed above
-
start
(*args, **kwargs)¶ @overrides: AbstractTask
-
startTimer
(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int¶
-
staticMetaObject
= <PyQt5.QtCore.QMetaObject object>¶
-
status
¶
-
statusChanged
¶
-
statusReplaced
¶
-
taskDirSetting
()¶ Returns the taskdir spec. See specifyTaskDir() for details.
-
taskDone
¶
-
taskFailed
¶
-
taskStarted
¶
-
thread
(self) → QThread¶
-
timerEvent
(self, QTimerEvent)¶
-
toDict
(*args, **kwargs)¶
-
toJson
(_mark_version=True)¶ Create and returns a data structure made up of jsonable items.
Return type: An instance of one the classes from NATIVE_JSON_DATATYPES
-
toJsonImplementation
(*args, **kwargs)¶
-
tr
(self, str, disambiguation: str = None, n: int = -1) → str¶
-
valueChanged
¶
-
wait
(timeout=None)¶ Block until the task is finished executing or
timeout
seconds have passed.Parameters: timeout (NoneType or int) – Amount of time in seconds to wait before timing out. If None or a negative number, this method will wait until the task is finished.
-
wrapCmdInLaunchApi
(cmd)¶
-
write
(skip_preprocessing=False)¶
-
writeJsonFile
(filename)¶
-
writeStuZipFile
()¶
-
class