schrodinger.tasks.taskmanager module¶
-
class
schrodinger.tasks.taskmanager.
TaskManager
(base_name='', **kwargs)¶ Bases:
schrodinger.models.mappers.TargetMixin
,schrodinger.models.parameters.ParamModel
-
auto_update_target
= False¶
-
namer
¶ Component class for TaskManager. Is responsible for choosing the name for the next task run from the task manager. The base_name is used to construct standard names which automatically increment. If a custom_name is set, it will override any standard name. If the custom_name is cleared or set to the standard name, naming will become standard again.
-
taskStarted
¶
-
taskEnded
¶
-
newTaskLoaded
¶
-
task_list
¶ A list param that contains
CompoundParam
(orParamModel
) instances. Any time the value of an item in the list is changed, theParamListParam
will emit anitemChanged
signal.
-
taskStatusChanged
¶
-
NAME_NOT_UNIQUE_MSG
= 'Task name is not unique.'¶
-
TaskClass
¶ 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 Owner(object): data_x = IntParam() data_y = IntParam()
An instance of the Owner class can be created normally, and Params can be accessed as normal attributes:
owner_instance = Owner() owner_instance.data_x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON.Warning
As descriptors, instances of this class will not behave correctly if used as class variables.
Variables: - DataClass (type) – The type of data the param describes.
- is_abstract (bool) – Whether this param is an abstract (ie class attribute) param.
- valueChanged (QtCore.pyqtSignal) – A signal emitted whenever the param is changed.
- default_value (DataClass) – The default value of the param. If unset, the default
value is whatever value is created when calling
DataClass()
- param_name (str) – The name of the attribute this param is set as. For
example,
Owner.data_x.param_name
would be ‘data_x’. - instance_attr_name (str) – The name of the attribute used to store param values on instances.
- abstract_attr_name (str) – The name of the attribute used to store abstract params on class objects.
-
startable
¶
-
__init__
(base_name='', **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
status
¶
-
statusChanged
¶
-
wait
(timeout=None)¶
-
removeTask
(task)¶
-
nextTask
()¶
-
startNextTask
()¶
-
getTaskByName
(name)¶
-
targetGetValue
()¶
-
targetSetValue
(value)¶
-
setTask
(task)¶
-
__len__
()¶
-
__repr__
()¶ Return repr(self).
-
DataClass
¶ alias of
builtins.object
-
TaskClassChanged
¶
-
TaskClassReplaced
¶
-
__class__
¶ alias of
sip.wrappertype
-
__deepcopy__
(memo)¶
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.tasks.taskmanager', 'auto_update_target': False, '_status': <Abstract:TaskManager._status>, 'namer': <Abstract:TaskManager.namer>, 'taskStarted': <unbound PYQT_SIGNAL TaskManager.taskStarted[AbstractTask]>, 'taskEnded': <unbound PYQT_SIGNAL TaskManager.taskEnded[AbstractTask]>, 'newTaskLoaded': <unbound PYQT_SIGNAL TaskManager.newTaskLoaded[AbstractTask]>, 'task_list': <Abstract:TaskManager.task_list>, 'taskStatusChanged': <unbound PYQT_SIGNAL TaskManager.taskStatusChanged[AbstractTask, Status]>, 'NAME_NOT_UNIQUE_MSG': 'Task name is not unique.', 'TaskClass': <Abstract:TaskManager.TaskClass>, 'startable': <Abstract:TaskManager.startable>, '__init__': <function TaskManager.__init__>, '_onTaskClassChanged': <function TaskManager._onTaskClassChanged>, '_onNamerChanged': <function TaskManager._onNamerChanged>, 'status': <property object>, 'statusChanged': <property object>, 'wait': <function TaskManager.wait>, '_onTaskStatusChanged': <function TaskManager._onTaskStatusChanged>, 'removeTask': <function TaskManager.removeTask>, '_getAggregateStatus': <function TaskManager._getAggregateStatus>, '_loadNewTask': <function TaskManager._loadNewTask>, '_onTaskNameChanged': <function TaskManager._onTaskNameChanged>, 'nextTask': <function TaskManager.nextTask>, 'startNextTask': <function TaskManager.startNextTask>, 'getTaskByName': <function TaskManager.getTaskByName>, '_validateTask': <function TaskManager._validateTask>, '_connectTask': <function TaskManager._connectTask>, 'targetGetValue': <function TaskManager.targetGetValue>, 'targetSetValue': <function TaskManager.targetSetValue>, 'setTask': <function TaskManager.setTask>, '__len__': <function TaskManager.__len__>, '__repr__': <function TaskManager.__repr__>, '__doc__': None, '_TaskManager_jsonAdapters': [], '_child_param_names': ['_status', 'namer', 'task_list', 'TaskClass', 'startable'], '_statusChanged': <unbound PYQT_SIGNAL TaskManager._statusChanged[object]>, '_statusReplaced': <unbound PYQT_SIGNAL TaskManager._statusReplaced[object, object]>, 'namerChanged': <unbound PYQT_SIGNAL TaskManager.namerChanged[object]>, 'namerReplaced': <unbound PYQT_SIGNAL TaskManager.namerReplaced[object, object]>, 'task_listChanged': <unbound PYQT_SIGNAL TaskManager.task_listChanged[object]>, 'task_listReplaced': <unbound PYQT_SIGNAL TaskManager.task_listReplaced[object, object]>, 'TaskClassChanged': <unbound PYQT_SIGNAL TaskManager.TaskClassChanged[object]>, 'TaskClassReplaced': <unbound PYQT_SIGNAL TaskManager.TaskClassReplaced[object, object]>, 'startableChanged': <unbound PYQT_SIGNAL TaskManager.startableChanged[object]>, 'startableReplaced': <unbound PYQT_SIGNAL TaskManager.startableReplaced[object, object]>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
(other)¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__get__
(owner_instance, owner_class)¶ Returns the value of this param for the specific owner instance. If the value has not been set, the default value will be returned.
Parameters: - owner_instance (object) – the instance on which this param is an attribute. The value returned will correspond to this instance.
- owner_class (type) – the class of the owner.
-
__getattr__
(self, str) → object¶
-
__getattribute__
(name)¶ If an
AttributeError
is raised during the getting of a child param, recast the error as aParamAttributeError
and raise. Otherwise, proceed normally.
-
__gt__
¶ Return self>value.
-
__hash__
= None¶
-
classmethod
__init_subclass__
()¶ This method modifies the creation of CompoundParam subclasses by dynamically adding a signal to the compound param for each subparam. The signal is named <subparam-name>Changed. (ex.
coord.xChanged
andcoord.yChanged
). This way, subclasses of CompoundParam do not need to explicitly define signals for each subparam.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.tasks.taskmanager'¶
-
__ne__
(other)¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__set__
(owner_instance, value)¶ Set the value of this param for the specific owner instance.
Parameters: - owner_instance (object) – the instance on which this param is an attribute. The value returned will correspond to this instance.
- value (self.DataClass) – the value to set this param to
-
__set_name__
(owner_name, name)¶ Saves the name this param is saved as.
Parameters: - owner_instance (object) – The instance on which this param is an attribute.
- name (str) – The name of the attribute this descriptor was set to.
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
()¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
aboutToReplace
¶
-
auto_update_model
= True¶
-
blockSignals
(self, bool) → bool¶
-
childEvent
(self, QChildEvent)¶
-
children
(self) → object¶
-
connectNotify
(self, QMetaMethod)¶
-
customEvent
(self, QEvent)¶
-
deleteLater
(self)¶
-
destroyed
¶ destroyed(self, QObject = None) [signal]
-
disconnect
(self)¶
-
disconnectNotify
(self, QMetaMethod)¶
-
dumpObjectInfo
(self)¶
-
dumpObjectTree
(self)¶
-
dynamicPropertyNames
(self) → object¶
-
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.
-
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¶
-
installEventFilter
(self, QObject)¶
-
isDefault
()¶
-
isSignalConnected
(self, QMetaMethod) → bool¶
-
isWidgetType
(self) → bool¶
-
isWindowType
(self) → bool¶
-
is_abstract
= True¶
-
killTimer
(self, int)¶
-
metaObject
(self) → QMetaObject¶
-
moveToThread
(self, QThread)¶
-
namerChanged
¶
-
namerReplaced
¶
-
objectName
(self) → str¶
-
objectNameChanged
¶ objectNameChanged(self, str) [signal]
-
owner
()¶ Returns the owner of this param. Works for both concrete and abstract params. Returns None if the param has no owner. Follows the same rules as ownerChain.
-
ownerChain
()¶ Returns the owner chain for this param. This works for concrete params and abstract params. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a regular param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, bar, atom.coord, x]
where Foo is a class and all other items are abstract params.
-
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)¶ Resets this compound param to its default value. If no arguments are passed in, the entire param is reset. Any number of abstract params may be optionally passed in to perform a partial reset to default value of specified sub-params. For example, given a compound param with two xyz coordinates as endpoints:
- class Line(CompoundParam):
- start = Coord(x=1, y=2, z=3) end = Coord(x=4, y=5, z=6)
line = Line()
We can reset the entire line:
line.reset()Or just certain parts:
line.reset(Line.start.x) # resets just start.x line.start.reset(Coord.x) # another way to reset start.x line.reset(Line.end) # resets the entire end point line.reset(Line.start.z, Line.end.z) # resets the z-coord of bothParameters: args – abstract sub-params of self
-
sender
(self) → QObject¶
-
senderSignalIndex
(self) → int¶
-
setObjectName
(self, str)¶
-
setParent
(self, QObject)¶
-
setProperty
(self, str, Any) → bool¶
-
setValue
(value=None, **kwargs)¶ Set the value of this compound param instance. This mutates the compound param to be equal to
value
; it does not make the compound param /identical/ tovalue
.Parameters: value (self.DataClass or dict) – either another param instance of the same type or a dictionary mapping the sub-param names to values.
-
signalsBlocked
(self) → bool¶
-
startTimer
(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int¶
-
startableChanged
¶
-
startableReplaced
¶
-
staticMetaObject
= <PyQt5.QtCore.QMetaObject object>¶
-
suspend_signals
()¶
-
targetValueChanged
¶
-
task_listChanged
¶
-
task_listReplaced
¶
-
thread
(self) → QThread¶
-
timerEvent
(self, QTimerEvent)¶
-
toDict
()¶
-
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
()¶ Returns a JSON representation of this value object.
-
tr
(self, str, disambiguation: str = None, n: int = -1) → str¶
-
valueChanged
¶
-