schrodinger.application.jaguar.gui.utils module¶
Utility functions and classes for the Jaguar GUIs
- class schrodinger.application.jaguar.gui.utils.Solvent(name, keyvalue, dielectric, radius, weight, density)¶
Bases:
tuple
- density¶
Alias for field number 5
- dielectric¶
Alias for field number 2
- keyvalue¶
Alias for field number 1
- name¶
Alias for field number 0
- radius¶
Alias for field number 3
- weight¶
Alias for field number 4
- schrodinger.application.jaguar.gui.utils.is3cTheory(theory)¶
- Returns
True if the current theory involves 3c functionals, which are tied to a specific basis, False otherwise.
- Return type
bool
- schrodinger.application.jaguar.gui.utils.count_num_strucs(input_selector)¶
Count the number of structures currently specified in the input selector widget. Since Jaguar can’t accept more than three structures, this function will return 4 for all values >= 4.
- Parameters
input_selector (
schrodinger.ui.qt.input_selector.InputSelector
) – The input selector widget
- exception schrodinger.application.jaguar.gui.utils.JaguarSettingError¶
Bases:
Exception
An exception indicating that there was an error with the user-specified Jaguar settings
- exception schrodinger.application.jaguar.gui.utils.JaguarSettingWarning¶
Bases:
UserWarning
A warning indicating that a user-specified Jaguar settings could not be loaded into the GUI
- schrodinger.application.jaguar.gui.utils.find_key_for_value(mydict, value)¶
This function finds key corresponding to a given value in a dictionary. We assume here that values in a given dictionary are unique.
- Parameters
mydict (dict) – dictionary
value – value in dictionary. It can be any hashable type.
- Returns
key, which can be any type.
- schrodinger.application.jaguar.gui.utils.validate_le_float_input(widget, msg=None)¶
This function checks whether a given line edit widget has a valid input. If it does it will return a float value. Otherwise an exception will be raised. This function should only be used for line edits used to enter float numbers.
- Parameters
widget (
QLineEdit
) – line edit widgetmsg (str) – text of exception error message
- Returns
valid float number
- Return type
float
- schrodinger.application.jaguar.gui.utils.catch_jag_errors(func, *args, **kwargs)¶
A decorator that will display any
JaguarSettingError
instances in an error dialog.- Returns
If the decorated function raised a
JaguarSettingError
, False will be returned. Otherwise, the return value of the decorated function will be returned.
- schrodinger.application.jaguar.gui.utils.warn_about_mmjag_unknowns(jag_input, parent=None)¶
If the JaguarInput object contains any unknown keywords, warn the user about the unknowns and ask them if they want to continue.
- Parameters
jag_input (schrodinger.application.jaguar.input.JaguarInput) – The JaguarInput object to check for unknown keywords
parent (QtWidgets.QWidget) – The Qt parent widget for the warning dialog
- Returns
True if we should continue (either there were no unknown keywords, or there were but the user wants to continue). False if we should cancel.
- Return type
bool
- schrodinger.application.jaguar.gui.utils.calculate_num_protons(struc)¶
Calculate the number of protons in the specified structure
- Parameters
struc (schrodinger.structure.Structure) – The structure to calculate protons in
- Returns
The number of protons
- Return type
int
- schrodinger.application.jaguar.gui.utils.get_atom_info(ws_atom_num)¶
Get information about the specified workspace atom
- Parameters
ws_atom_num (int) – The workspace atom number
- Returns
A tuple of:
The atom name (after Jaguar atom naming has been applied)
The atom number relative to the entry (rather than relative to the workspace structure)
The entry id
The entry title
- Return type
tuple
- schrodinger.application.jaguar.gui.utils.atom_name_regex = re.compile('^([^\\W\\d]+)(\\d+)$')¶
A regular expression that matches Jaguar atom names. Group 1 of the match is the element and group 2 is the number.
- schrodinger.application.jaguar.gui.utils.atom_name_sort_key(atom_name)¶
Convert a Jaguar atom name into a key for use in sorting by number
- Parameters
atom_name (str) – The atom name
- Returns
A tuple of (atom number, element)
- Return type
tuple
- schrodinger.application.jaguar.gui.utils.generate_job_name(struc_name, task_name, theory, basis)¶
Generate an appropriate job name for a job with the specified settings. Any settings that are specified as None will be omitted from the job name. If a directory or file with the specified name exists in the current directory, an integer will be appended to the job name.
- Note
If generating multiple job names, the input for each job must be saved before the next job name is generated. Otherwise, this function will not be able to append the appropriate integer.
- Parameters
struc_name (str or NoneType) – The structure title
task_name (str or NoneType) – The task name (i.e. a shortened version of the panel name
theory (str or NoneType) – The theory method. Should be “HF”, “LMP2”, or the DFT functional.
basis (str or NoneType) – The basis name
- Returns
The job name
- Return type
str
- class schrodinger.application.jaguar.gui.utils.EnhancedComboBox(parent=None, items=None, default_item='', default_index=0, command=None, nocall=False, layout=None, tip='', itemdict=None, adjust_to_contents=True, min_width=None)¶
Bases:
schrodinger.ui.qt.swidgets.SComboBox
A combo box for use in the Jaguar GUI with several Pythonic enhancements
- setCurrentMmJagData(jag_input, keyword, setting_name)¶
Set the combo box selection based on the specified mmjag setting The combo box user data must match the mmjag keyword values. If no matching setting is found, a warning will be issued.
- Parameters
jag_input (
schrodinger.application.jaguar.input.JaguarInput
) – A JaguarInput object containing the settings to loadkeyword (str) – The mmjag keyword to load
setting_name (str) – The name of the setting that is being set. This name will only be used when issuing warnings.
- class schrodinger.application.jaguar.gui.utils.PropertiesTableWidget(*args, **kwargs)¶
Bases:
PyQt6.QtWidgets.QTableWidget
A QTableWidget for the Properties table on the Properties tab
- __init__(*args, **kwargs)¶
- shrinkRowHeight()¶
Shrink the row height to eliminate unnecessary vertical padding
- sizeHint()¶
Set the preferred size of the table so that all rows are visible.
- class schrodinger.application.jaguar.gui.utils.WorkspaceInclusionCheckBox(parent=None)¶
Bases:
PyQt6.QtWidgets.QCheckBox
A checkbox that is skinned to look like the Project Table workspace inclusion checkbox. This checkbox is used in the Transition State and IRC tabs.
- Note
This skinning could be done using a style sheet, but that requires separate images for checked + disabled and unchecked + disabled. By using a QIcon, these disabled images are generated automatically.
- __init__(parent=None)¶
- paintEvent(self, a0: Optional[QPaintEvent])¶
- class schrodinger.application.jaguar.gui.utils.ProjTableLikeView(parent=None)¶
Bases:
PyQt6.QtWidgets.QTableView
A table view that mimics the selecting and editing behaviors of the Project Table
- __init__(parent=None)¶
- selectionCommand(index, event=None)¶
Don’t update the current selection when using the keyboard to navigate or when clicking on a selected editable item.
- Parameters
index (
PyQt5.QtCore.QModelIndex
) – The newly selected indexevent (
PyQt5.QtCore.QEvent
) – The event that triggered the index change
- Returns
A flag describing how the selection should be updated
- Return type
int
- commitDataToSelected(editor, index, delegate)¶
Commit data to all selected cells in the column that is currently being edited.
- Parameters
editor (
PyQt5.QtWidgets.QWidget
) – The editor being used to enter dataindex (
PyQt5.QtCore.QModelIndex
) – The index being editeddelegate (
PyQt5.QtWidgets.QAbstractItemDelegate
) – The delegate used to create the editor
- setItemDelegateForColumn(column, delegate, connect_selected=False)¶
Set the delegate for the specified column. Note that this function adds the optional
connect_selected
argument not present in the QTableView function.- Parameters
column (int) – The column to set the delegate for
delegate (
PyQt5.QtWidgets.QAbstractItemDelegate
) – The delegate to setconnect_selected (bool) – If True, the delegate’s commitDataToSelected signal will be connected
- class schrodinger.application.jaguar.gui.utils.SpinTreatment(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
enum.Enum
An enumeration of the possible spin treatment settings. Enum values correspond to mmjag settings.
- NA = None¶
- Restricted = 0¶
- Unrestricted = 1¶
- Automatic = 2¶
- unrestrictedAvailable()¶
Does the current spin treatment setting allow for an unrestricted waveform?
- Returns
True for unrestricted or automatic spin treatments. False otherwise.
- Return type
bool