schrodinger.tasks.tasks_ module

class schrodinger.tasks.tasks_.ExceptionInfo(value, traceback)

Bases: tuple

traceback

Alias for field number 1

value

Alias for field number 0

class schrodinger.tasks.tasks_.Status

Bases: enum.IntEnum

An enumeration.

NOTRUNNING = 0
STARTING = 1
RUNNING = 2
FAILED = 3
DONE = 4
schrodinger.tasks.tasks_.wait(self, 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.
class schrodinger.tasks.tasks_.AbstractTask(**kwargs)

Bases: schrodinger.ui.qt.appframework2.validation.ValidationMixin, schrodinger.models.parameters.ParamModel

input

Inherit all functionality of CompoundParam with name that designates this class as a model. Models should themselves be parameters so that their corresponding view can be easily incorporated into a parent view. In this case, the model of the parent view will contain the model of the child view as a parameter.

WARNING: as descriptors, instances of this class will not behave normally if used as class variables.

output

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
name
status
statusChanged
start()
postprocess()
preprocess()
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.
inputChanged
inputReplaced
nameChanged
nameReplaced
outputChanged
outputReplaced
startableChanged
startableReplaced
class schrodinger.tasks.tasks_.AbstractFunctionTask(**kwargs)

Bases: schrodinger.tasks.tasks_.AbstractTask

start()
mainFunction()
class schrodinger.tasks.tasks_.BlockingFunctionTask(**kwargs)

Bases: schrodinger.tasks.tasks_.AbstractFunctionTask

class schrodinger.tasks.tasks_.ThreadFunctionTask(*args, **kwargs)

Bases: schrodinger.tasks.tasks_.AbstractFunctionTask

running_tasks = []
MAX_THREAD_TASKS = 500
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.
class schrodinger.tasks.tasks_.SubprocessCmdTask

Bases: schrodinger.tasks.tasks_.AbstractTask

makeCmd()
start()
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.
kill()
class schrodinger.tasks.tasks_.TaskManager(base_name='', **kwargs)

Bases: schrodinger.models.mappers.DefaultTargetMixin, 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
task_list

A list param that contains CompoundParam (or ParamModel) instances. Any time the value of an item in the list is changed, the ParamListParam will emit an itemChanged 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
status
statusChanged
wait(timeout=None)
removeTask(task)
nextTask()
startNextTask()
getTaskByName(name)
targetGetValue()
targetSetValue(value)
TaskClassChanged
TaskClassReplaced
namerChanged
namerReplaced
startableChanged
startableReplaced
task_listChanged
task_listReplaced