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
uiand stores itui_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_layoutandbottom_layout.If the user has specified the
uidata member, insert the resultantui_widgetintomain_layout.If the widget already has a layout defined, this method will produce a warning (but not a traceback).
main_layoutandbottom_layoutwill be inserted into the existing widget layout, which will not be the same aswidget_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.
- hostLabel() QLabel¶
- controlsWidget() QWidget¶
Return a widget containing all user-configurable controls for the host selector.
- 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'¶
- Panel = 'panel'¶
- class schrodinger.ui.qt.tasks.host_selectors.HostSelector(*args, **kwargs)¶
Bases:
TargetMixin,AbstractHostSelectorA 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'¶
- Panel = 'panel'¶
- class schrodinger.ui.qt.tasks.host_selectors.SubjobHostSelector(*args, show_max_procs_widget: bool = False, **kwargs)¶
Bases:
MapperMixin,AbstractHostSelectorA 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
uiand stores itui_widget.Suggested subclass use: create and initialize subwidgets, and connect signals.
- initLayOut()¶
@overrides: widgetmixins.InitMixin
- initSetDefaults()¶
@overrides: widgetmixins.InitMixin
- defineMappings()¶
Override this in the subclass to define mappings. Should return a list of tuples [(<target>, <param>)]. Targets can be:
a basic widget, like
QLineEditorQComboBoxa custom object that inherits
MapperMixinorTargetMixina
TargetSpecinstancea 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
TargetSpecobject, 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)]
- maxProcsLabel() QLabel¶
- maxProcsSpinBox() QSpinBox¶
- maxProcsWidgetIsVisible() bool¶
- setMaxProcsWidgetVisible(visible: bool) None¶
- setAllowedHostTypes(allowed_host_types: AllowedHostTypes) None¶
- host() str | None¶
- setHost(host_name: str) None¶
- Default = 'default'¶
- Panel = 'panel'¶