schrodinger.ui.qt.tasks.host_selectors module

Host selector widgets to be used with job settings dialogs. Not to be confused with host selectors for job _config_ dialogs.

class schrodinger.ui.qt.tasks.host_selectors.AbstractHostSelector(host_lbl_text: str = 'Host:', allowed_host_types: AllowedHostTypes = AllowedHostTypes.CPU_ONLY, **kwargs)

Bases: BaseWidget

PLACEHOLDER_PROP = 'is_showing_placeholder'
PLACEHOLDER_QSS = '\n        QComboBox[is_showing_placeholder="true"] {font-style: italic}\n        QComboBox[is_showing_placeholder="false"] {font-style: normal}\n        '
PLACEHOLDER_GPU_TEXT = '(no GPUs found)'
__init__(host_lbl_text: str = 'Host:', allowed_host_types: AllowedHostTypes = AllowedHostTypes.CPU_ONLY, **kwargs) None
Parameters:
  • host_lbl_text – The text to display next to the host combo.

  • allowed_host_types – The types of hosts to allow in the host combo.

initSetUp()

Creates widget from ui and stores it ui_widget.

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

hostLabel() QLabel
hostCombo() MappableComboBox
allowedHostTypes() AllowedHostTypes
setAllowedHostTypes(allowed_host_types: AllowedHostTypes) None
host() str | None
setHost(host_name: str) None
updateHosts() str | None

Update the available hosts in the host combo. If the currently selected host is no longer available, we select a new host and return a message indicating the change. Otherwise, return None.

Default = 'default'
FooterContrast = 'footer_contrast'
Panel = 'panel'
class schrodinger.ui.qt.tasks.host_selectors.HostSelector(*args, **kwargs)

Bases: TargetMixin, AbstractHostSelector

A host selector that can be used to specify settings for a job host that supports only one processor.

__init__(*args, **kwargs) None
targetGetValue() str | None
targetSetValue(value: str | None) None
host() str | None
setHost(host_name: str) None
Default = 'default'
FooterContrast = 'footer_contrast'
Panel = 'panel'
class schrodinger.ui.qt.tasks.host_selectors.SubjobHostSelector(*args, show_max_procs_widget: bool = False, **kwargs)

Bases: MapperMixin, AbstractHostSelector

A host selector that can be used to specify settings for a subjob host that supports one or more processors.

model_class

alias of SubjobSettings

__init__(*args, show_max_procs_widget: bool = False, **kwargs) None
Parameters:

show_max_procs_widget – Whether the max procs widget should be visible initially.

initSetUp()

Creates widget from ui and stores it ui_widget.

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

initSetDefaults()

@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)]
totalLabel() QLabel
maxProcsSpinBox() QSpinBox
unitsLabel() QLabel
maxProcsWidgetsAreVisible() bool
setMaxProcsWidgetsVisible(visible: bool) None
setAllowedHostTypes(allowed_host_types: AllowedHostTypes) None
host() str | None
setHost(host_name: str) None
Default = 'default'
FooterContrast = 'footer_contrast'
Panel = 'panel'
schrodinger.ui.qt.tasks.host_selectors.add_host_selector_to_layout(selector: AbstractHostSelector, layout: QGridLayout) None

Add all subwidgets of the provided selector to the next empty row of the provided grid layout in the appropriate order.