schrodinger.ui.qt.tasks.configwidgets module

class schrodinger.ui.qt.tasks.configwidgets.ConfigWidgetMixin(*args, **kwargs)

Bases: schrodinger.models.advanced_mappers.ModelBaseClassMapperMixin

model_base_class

alias of schrodinger.tasks.jobtasks.JobConfig

property config
makeInitialModel()
class schrodinger.ui.qt.tasks.configwidgets.HostSelector(*args, **kwargs)

Bases: schrodinger.models.mappers.MapperMixin, schrodinger.ui.qt.basewidgets.BaseWidget

Variables

PLACEHOLDER_TEXTS – Placeholders to put in the host combo when no hosts are available based on the currently allowed host types.

model_class

alias of schrodinger.tasks.jobtasks.HostSettings

VALID_STATE_PROP = 'valid_state'
VALIDATION_STYLE_SHEET = '\n        QComboBox[valid_state="true"] {font-style: normal}\n        QComboBox[valid_state="false"] {font-style: italic}\n        '
PLACEHOLDER_TEXTS = {<AllowedHostTypes.CPU_ONLY: 1>: '(no CPUs found)', <AllowedHostTypes.GPU_ONLY: 2>: '(no GPUs found)', <AllowedHostTypes.CPU_AND_GPU: 3>: '(no hosts found)'}
property host_combo
property units_lbl
property num_subjobs_sb
initSetUp()

Creates widget from ui and stores it ui_widget.

Suggested subclass use: create and initialize subwidgets, and connect signals.

initLayOut()

@overrides: widgetmixins.InitMixin

initSetDefaults()

@overrides: widgetmixins.InitMixin

getLabelText()
setLabelText(new_text: str)
getLabel() PyQt6.QtWidgets.QLabel
Returns

Leading host label.

getHostCombo() schrodinger.ui.qt.mapperwidgets._comboboxes.MappableComboBox
Returns

Host combo box.

getSubjobsLabel() PyQt6.QtWidgets.QLabel
Returns

Sub jobs label.

getNumSubjobsSpinbox() PyQt6.QtWidgets.QSpinBox
Returns

Sub jobs spinbox.

getSubjobsUnitLabel() PyQt6.QtWidgets.QLabel
Returns

Sub jobs unit label.

updateHostsList() Optional[str]

Updates the list of hosts available in this HostSelector.

Returns

A message to display to the user if the selected host was updated.

defineMappings()

Override this in the subclass to define mappings. Should return a list of tuples [(<target>, <param>)]. Targets can be:

  1. a basic widget, like QLineEdit or QComboBox

  2. a custom object that inherits MapperMixin or TargetMixin

  3. a TargetSpec instance

  4. a slot

For common widgets, standard signals and getter/setter methods will be used, as defined in mappers._get_default_access_names().

For more fine-grained custom control, instantiate a TargetSpec object, which allows custom setters, getters, and signals to be specified.

Supplying a slot as the first element of the tuple is equivalent to providing TargetSpec(slot=my_slot).

Note that all target slots are triggered on setModel() as well as in response to the specified signal.

The param is an abstract param reference, e.g. MyModel.my_param.

Example:

def defineMappings(self):
    combo = self.style_combo
    return [(self.name_le, MyModel.name),
            (TargetSpec(combo,
                    getter=combo.currentText,
                    setter=combo.setCurrentText), MyModel.style),
            (self.coord_widget, MyModel.coord),
            (self._onASLTextChanged, MyModel.asl_text)]
getPlaceholderText() str

Return the placeholder text for the currently allowed host types.

class schrodinger.ui.qt.tasks.configwidgets.HostLayoutWidget(*args, **kwargs)

Bases: schrodinger.ui.qt.basewidgets.BaseWidget

A display widget for showing one or more HostSelectors. When multiple host selectors are added, the host selectors are shown inside of a group box. To use, instantiate and add host selectors using the addHostSelector method.

initSetUp()

Creates widget from ui and stores it ui_widget.

Suggested subclass use: create and initialize subwidgets, and connect signals.

initLayOut()

Create a vertical layout for the widget (widget_layout) and populate it with two vertical sub-layouts: main_layout and bottom_layout.

If the user has specified the ui data member, insert the resultant ui_widget into main_layout.

If the widget already has a layout defined, this method will produce a warning (but not a traceback). main_layout and bottom_layout will be inserted into the existing widget layout, which will not be the same as widget_layout. It is therefore recommended that this mixin is used only with widgets that do not already have a layout.

Suggested subclass use: create, initialize, and populate layouts.

addHostSelector(selector)
setHostSelectorOrder(selectors)
class schrodinger.ui.qt.tasks.configwidgets.IncorporationSelector(*args, **kwargs)

Bases: schrodinger.ui.qt.tasks.configwidgets.ConfigWidgetMixin, schrodinger.ui.qt.basewidgets.BaseWidget

Mode

alias of schrodinger.tasks.jobtasks.IncorporationMode

MODE_TEXT = {<IncorporationMode.APPEND: 'append'>: 'Append new entries as a new group', <IncorporationMode.APPENDINPLACE: 'appendinplace'>: 'Append new entries in place', <IncorporationMode.REPLACE: 'replace'>: 'Replace existing entries', <IncorporationMode.IGNORE: 'ignore'>: 'Do not incorporate'}
initSetUp()

Creates widget from ui and stores it ui_widget.

Suggested subclass use: create and initialize subwidgets, and connect signals.

initLayOut()

@overrides: widgetmixins.InitMixin

defineMappings()

Override this in the subclass to define mappings. Should return a list of tuples [(<target>, <param>)]. Targets can be:

  1. a basic widget, like QLineEdit or QComboBox

  2. a custom object that inherits MapperMixin or TargetMixin

  3. a TargetSpec instance

  4. a slot

For common widgets, standard signals and getter/setter methods will be used, as defined in mappers._get_default_access_names().

For more fine-grained custom control, instantiate a TargetSpec object, which allows custom setters, getters, and signals to be specified.

Supplying a slot as the first element of the tuple is equivalent to providing TargetSpec(slot=my_slot).

Note that all target slots are triggered on setModel() as well as in response to the specified signal.

The param is an abstract param reference, e.g. MyModel.my_param.

Example:

def defineMappings(self):
    combo = self.style_combo
    return [(self.name_le, MyModel.name),
            (TargetSpec(combo,
                    getter=combo.currentText,
                    setter=combo.setCurrentText), MyModel.style),
            (self.coord_widget, MyModel.coord),
            (self._onASLTextChanged, MyModel.asl_text)]
class schrodinger.ui.qt.tasks.configwidgets.JobnameWidget(*args, **kwargs)

Bases: schrodinger.ui.qt.tasks.configwidgets.ConfigWidgetMixin, schrodinger.ui.qt.basewidgets.BaseWidget

nameUpdated

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

initSetUp()

Creates widget from ui and stores it ui_widget.

Suggested subclass use: create and initialize subwidgets, and connect signals.

initLayOut()

@overrides: widgetmixins.InitMixin

setText(text)
defineMappings()

Override this in the subclass to define mappings. Should return a list of tuples [(<target>, <param>)]. Targets can be:

  1. a basic widget, like QLineEdit or QComboBox

  2. a custom object that inherits MapperMixin or TargetMixin

  3. a TargetSpec instance

  4. a slot

For common widgets, standard signals and getter/setter methods will be used, as defined in mappers._get_default_access_names().

For more fine-grained custom control, instantiate a TargetSpec object, which allows custom setters, getters, and signals to be specified.

Supplying a slot as the first element of the tuple is equivalent to providing TargetSpec(slot=my_slot).

Note that all target slots are triggered on setModel() as well as in response to the specified signal.

The param is an abstract param reference, e.g. MyModel.my_param.

Example:

def defineMappings(self):
    combo = self.style_combo
    return [(self.name_le, MyModel.name),
            (TargetSpec(combo,
                    getter=combo.currentText,
                    setter=combo.setCurrentText), MyModel.style),
            (self.coord_widget, MyModel.coord),
            (self._onASLTextChanged, MyModel.asl_text)]
class schrodinger.ui.qt.tasks.configwidgets.ConfigDialog(*args, **kwargs)

Bases: schrodinger.ui.qt.tasks.configwidgets.ConfigWidgetMixin, schrodinger.ui.qt.basewidgets.BaseOptionsDialog

ui_module = <module 'schrodinger.ui.qt.tasks.config_dialog_ui' from '/scr/buildbot/savedbuilds/2024-3/NB/build-133/internal/lib/python3.11/site-packages/schrodinger/ui/qt/tasks/config_dialog_ui.py'>
startRequested

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

openRequested

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

initSetOptions()

Suggested subclass use: set instance variables, excluding layouts and subwidgets. Also use here to (optionally) apply the legacy stylesheet spacing settings (PANEL-19101).

initSetUp()

Creates widget from ui and stores it ui_widget.

Suggested subclass use: create and initialize subwidgets, and connect signals.

initLayOut()

@overrides: widgetmixins.InitMixin

setModel(*args, **kwargs)

Sets the model object for the mapper. Disconnects the old model, if one is set, and connects the new model. Pass in None to have no model set.

Parameters

model – the model instance or None

registerHostSelectorForHostUpdates(host_selector: schrodinger.ui.qt.tasks.configwidgets.HostSelector)

Register a HostSelector to be updated when the host list changes.

updateHostsList() Optional[str]

Updates the list of hosts available in all the registered HostSelectors. If the config dialog is not visible returns the message that would be displayed to the user else displays a dialog to the user and returns None.

defineMappings()

Override this in the subclass to define mappings. Should return a list of tuples [(<target>, <param>)]. Targets can be:

  1. a basic widget, like QLineEdit or QComboBox

  2. a custom object that inherits MapperMixin or TargetMixin

  3. a TargetSpec instance

  4. a slot

For common widgets, standard signals and getter/setter methods will be used, as defined in mappers._get_default_access_names().

For more fine-grained custom control, instantiate a TargetSpec object, which allows custom setters, getters, and signals to be specified.

Supplying a slot as the first element of the tuple is equivalent to providing TargetSpec(slot=my_slot).

Note that all target slots are triggered on setModel() as well as in response to the specified signal.

The param is an abstract param reference, e.g. MyModel.my_param.

Example:

def defineMappings(self):
    combo = self.style_combo
    return [(self.name_le, MyModel.name),
            (TargetSpec(combo,
                    getter=combo.currentText,
                    setter=combo.setCurrentText), MyModel.style),
            (self.coord_widget, MyModel.coord),
            (self._onASLTextChanged, MyModel.asl_text)]
run(*args, **kwargs)

Show this widget, while optionally blocking, making the widget window modal, and registering a callback for when the widget is closed again.

Parameters
  • blocking (bool) – if True, block progress in the calling method until the widget is closed again.

  • modal (bool) – if True, open this widget as window modal. Otherwise, open this widget as nonmodal.

  • finished_callback (a callable object) – an object that will be called with no arguments when this widget is closed.