schrodinger.application.jaguar.gui.tabs.base_tab module¶
- class schrodinger.application.jaguar.gui.tabs.base_tab.CombinedUi¶
Bases:
object
An object that provides access to widgets across multiple ui files
- class schrodinger.application.jaguar.gui.tabs.base_tab.BaseTab(parent, input_selector=None)¶
Bases:
PyQt6.QtWidgets.QWidget
The base class for all Jaguar tabs. Subclasses should define NAME, HELP_TOPIC, UI_MODULES, setup(), getMmJagKeywords(), restoreSettings(), and reset().
- Variables
NAME (str) – The name of the tab
HELP_TOPIC (str) – The help topic for the tab
UI_MODULES (tuple) – A tuple of ui modules defining the tab widgets. These ui modules should be listed top to bottom. Optionally, a tuple of (tab class, attribute name) may be listed instead of a ui file to include a subtab.
ui (CombinedUi) – An object that provides access to all widgets from all ui files. Note that widget names should be unique amongst all ui files for the tab.
task_name (str) – The name of the panel this tab is part of
input_selector (schrodinger.ui.qt.input_selector.InputSelector) – The AppFramework input selector frame from the panel containing this tab.
- NAME = ''¶
- HELP_TOPIC = ''¶
- UI_MODULES = None¶
- __init__(parent, input_selector=None)¶
Perform common tab initialization. All tab specific initialization should go in setup().
- Parameters
parent (PyQt5.QtWidgets.QWidget) – The Qt parent widget
input_selector (schrodinger.ui.qt.input_selector.InputSelector) – The panel’s input selector widget, if available.
- setup()¶
Perform tab specific initialization. This function should be defined in subclasses if initialization is needed.
- getDefaultKeywords()¶
Get the default keywords for this tab. Note that defaults that exist in mmjag should not be explicitly set here.
- getMmJagKeywords()¶
Return all keywords that should be put into the mmjag handle. This function should be defined in subclasses.
- Returns
All keywords that should be put into the mmjag handle
- Return type
dict
- Raises
schrodinger.application.jaguar.gui.utils.JaguarSettingError – If any settings are invalid.
- loadSettings(jag_input)¶
Restore tab settings from mmjag keywords. This function should be defined in subclasses.
- Parameters
jag_input (schrodinger.application.jaguar.input.JaguarInput) – The Jaguar settings to base the tab settings on
- loadPerAtomSettings(jag_input, eid=None, title=None)¶
Restore per-atom tab settings from mmjag keywords. This function should be defined in subclasses for any tabs that contain per-atom settings.
- Parameters
jag_input (schrodinger.application.jaguar.input.JaguarInput) – The Jaguar settings to base the tab settings on
eid (str) – The entry id of the structure in
jag_input
title (str) – The title of the structure in
jag_input
- saveSettings(jag_input, eid)¶
Save tab settings in jaguar handle. It is only used for settings which are not defined using keywords (typically per-atom settings). This function should be defined in subclasses for any tabs that contain per- atom settings.
- Parameters
jag_input (schrodinger.application.jaguar.input.JaguarInput) – The Jaguar handle to store the tab settings in
eid (str) – The entry id of the structure in
jag_input
- reset()¶
Reset the tab to its original state. Note that this function is only necessary for settings that are not stored in the mmjag handle. For mmjag settings, reset will be carried out using
loadSettings
with a defaultschrodinger.application.jaguar.input.JaguarInput
object. This function should only be defined in subclasses if there are any settings that cannot be reset vialoadSettings
.
- validate()¶
Make sure that the tab settings will allow a job to be run successfully. Note that this validation should not be redundant with that performed in
getMmJagKeywords
. Any tab setting that prevents valid mmjag keywords from being generated should causegetMmJagKeywords
to raise a JaguarSettingError. Any tab setting that allows mmjag keywords to be successfully generated but will result in a job failure should cause avalidate
fail. This function should be defined in subclasses if validation is needed.- Returns
If the validation passes, None is returned. If the validation fails, a string that describes the error is returned.
- Return type
str or NoneType
- error(msg)¶
Display an error dialog with the specified message
- Parameters
msg (str) – The message to include in the error dialog
- warning(msg)¶
Display a warning dialog with the specified message
- Parameters
msg (str) – The message to include in the warning dialog
- activate()¶
This function will be called whenever the user selects this tab. Subclasses can override it if necessary to, e.g., activate picking.
- deactivate()¶
This function will be called whenever the user selects a different tab. Subclasses can override it if necessary to, e.g., deactivate picking.
- class schrodinger.application.jaguar.gui.tabs.base_tab.ProvidesBasisMixin¶
Bases:
object
A mixin for tabs that allow the user to select a basis set. This mixin is used to find tabs (via basePanel.getTab()) that can provide basis information.
- Variables
basis_changed (PyQt5.QtCore.pyqtSignal) – A signal emitted when the basis set is changed
- basis_changed¶
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.
- getBasis(mixed_name='Mixed')¶
Get the currently selected basis. If more than one basis set is specified,
mixed_name
will be returned. If the tab does not allow for specifying multiple basis sets, then this argument may be ignored.- Parameters
mixed_name (str) – The name to return if more than one basis set is specified
- Returns
The currently selected basis
- Return type
str
- class schrodinger.application.jaguar.gui.tabs.base_tab.LoadsTheoryMixin¶
Bases:
object
A mixin for tabs that load theory settings from an input file.
- getTheoryLevel()¶
Get the current theory level
- Returns
The current theory level. Will be one of: “DFT”, “HF”, “LMP2”, “RIMP2” or “Mixed”
- Return type
str
- getAllUsedTheoryLevels()¶
- Returns
A tuple of all theory levels used
- Return type
tuple
- getMethod()¶
Get the current method. If the level of theory is DFT, the method is the functional (ex. “B3LYP” or “PWB6K”). For all other levels of theory, the method is the level of theory (“HF” or “LMP2” or “RIMP2”).
- Returns
The current method
- Return type
str
- getFunctional()¶
Get the current DFT functional (ex. “B3LYP” or “PWB6K”). If the theory level is not DFT, then None will be returned.
- Returns
The current DFT functional or None
- Return type
str or NoneType
- class schrodinger.application.jaguar.gui.tabs.base_tab.ProvidesTheoryMixin¶
Bases:
schrodinger.application.jaguar.gui.tabs.base_tab.LoadsTheoryMixin
A mixin for tabs that allow the user to select a theory level. This mixin is used to find tabs (via basePanel.getTab()) that can provide theory information.
- Variables
method_changed (PyQt5.QtCore.pyqtSignal) – A signal emitted when the theory level or DFT functional is changed
- method_changed¶
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.
- getTheoryLevelForEid(eid)¶
Return the theory level set for the specified entry ID.
- Parameters
eid (int) – Entry ID to get theory level for.
- Returns
The theory level set for this entry ID.
- Return type
str
- getMethodForEid(eid)¶
Return the method set for the specified entry ID.
- Parameters
eid (int) – Entry ID to get the method for
- Returns
Method for this entry ID
- Return type
str
- getCommonTheoryLevel()¶
- Returns
If all entries have the same theory level set, return the theory. level Otherwise return None
- Return type
str or None
- getCommonMethod()¶
- Returns
If all entries have the same method set, return the method. Otherwise return None
- Return type
str or None
- getCommonFunctional()¶
- Returns
If all entries use DFT and have the same functional set, return the functional. Otherwise return None.
- Return type
str or None
- class schrodinger.application.jaguar.gui.tabs.base_tab.ProvidesStructuresMixin¶
Bases:
object
A mixin for tabs that allow the user to select structures. This mixin is used to find tabs (via basePanel.getTab()) that can provide structure information.
- structureChanged¶
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.
- MULTIPLE_STRUC_JOB_TITLE = 'batch'¶
- getStructureTitleForJobname()¶
Get the structure title to be used in the job name. If the tab includes multiple structures, then
MULTIPLE_STRUC_JOB_TITLE
should be returned. If no structures have been specified yet, then None should be returned.- Returns
The structure title
- Return type
str or NoneType