schrodinger.application.jaguar.gui.input_tab_widgets module

class schrodinger.application.jaguar.gui.input_tab_widgets.UseFrom

Bases: Enum

included = 1
selected = 2
class schrodinger.application.jaguar.gui.input_tab_widgets.Basis(basis, polarization, diffuse)

Bases: Basis

Class for representing a basis set. The basis set name, polarization (i.e. *’s), and diffuse (i.e. +’s) are stored separately.

classmethod fromText(text)

Create a Basis object from a string

Parameters:

text (str) – The full basis set name including *’s and +’s

class schrodinger.application.jaguar.gui.input_tab_widgets.ProjEntry(row=None)

Bases: object

A class for accessing data about a project table row and the associated structure

__init__(row=None)

Instantiate a new object

Parameters:

row (schrodinger.project.ProjectRow or NoneType) – The project row. If not provided, no data will be loaded.

update(row)

Update this entry with information from the provided row

Parameters:

row (schrodinger.project.ProjectRow) – The project row

reset()

Reset any user-specified settings

setIncluded(value)

Include or remove this entry from the workspace.

Parameters:

value (int) – A flag indicated whether the entry should be removed from the workspace (WS_REMOVE), included in the workspace(WS_INCLUDED), or set as the only entry in the workspace (WS_INCLUDE_ONLY)

getCharge()

Get the user-specified charge on the structure. If no charge has been set, the default charge will be returned.

Returns:

A tuple of: - The charge (int) - Is this a user-specified charge (True) or the default charge (False)

Return type:

tuple

getSpinMult()

Get the user-specified spin multiplicity on the structure. If no spin multiplicity has been set or if the user-specified multiplicity is incompatible with the current charge, then the default spin multiplicity will be returned.

Returns:

A tuple of:

  • The spin multiplicity (int)

  • Is this a user-specified spin multiplicity (True) or the default spin multiplicity (False)

Return type:

tuple

getDefaultSpinMult()

Get the default spin multiplicity on the structure for the current charge

Returns:

The default spin multiplicity

Return type:

int

getStructure()

Get the entry structure

Returns:

The structure object

Return type:

schrodinger.structure.Structure

setBasisFromText(basis)

Set the basis

Parameters:

basis (str) – The full basis set name including *’s and +’s

setMethodFromText(theory)

Set the method

Parameters:

theory (str) – The method to be set.

getIgnoredSpinMult()

If the user has set an invalid spin multiplicity, return it

Returns:

If the user has set a spin multiplicity but it’s being ignored, return the user-specified spin multiplicity. Otherwise, return None.

Return type:

int or NoneType

setSpinMult(spin_mult)

Set the spin multiplicity

Parameters:

spin_mult (int) – The spin multiplicity to set

Returns:

True if this is a valid spin multiplicity for the current charge. False otherwise.

Return type:

bool

getStrucChargeAndSpinMult()

Get the structure, charge, and spin multiplicity settings. (This is intended for use in loading data into a ProjEntryTuple object.)

Returns:

A tuple of (entry_id, structure, charge, spin multiplicity)

Return type:

tuple

property row_charge

Make sure we provide an up to date row charge value

class schrodinger.application.jaguar.gui.input_tab_widgets.ProjEntryTuple(entry_id, struc, charge, spin_mult, basis, theory)

Bases: tuple

A simplified class for storing data about a project table row and the associated structure. Unlike ProjEntry, ProjEntryTuple contains data about the basis set even for structures using the default basis.

basis

Alias for field number 4

charge

Alias for field number 2

entry_id

Alias for field number 0

spin_mult

Alias for field number 3

struc

Alias for field number 1

theory

Alias for field number 5

class schrodinger.application.jaguar.gui.input_tab_widgets.InputEntriesColumns

Bases: object

Column constants for the selected entries table

HEADERS = ['ID', 'In', 'Entry Title', 'Charge', 'Spin Mult.', 'Theory', 'Basis Set']
NUM_COLS = 7
ID = 0
INCLUSION = 1
TITLE = 2
CHARGE = 3
SPIN_MULT = 4
THEORY = 5
BASIS = 6
class schrodinger.application.jaguar.gui.input_tab_widgets.InputEntriesModel(parent)

Bases: QAbstractTableModel

The data model for the input entries table

Variables:
  • ERROR_BACKGROUND_BRUSH (QtGui.QBrush) – The brush used to paint the background of cells containing invalid data

  • show_tool_tip (QtCore.pyqtSignal) – A signal indicating that the tool tip for the specified cell should explicitly be shown. This is used to notify the user when an invalid spin multiplicity has been entered. (Note that this signal has nothing to do with tool tips being shown when the user hovers over a cell.) This signal is emitted with the index of the cell to display the tool tip for.

  • basisChanged (QtCore.pyqtSignal) – Signal emitted when a new basis set is selected.

  • theoryChanged (QtCore.pyQtSignal) – Signal emitted when a new theory level is selected.

COLUMN

alias of InputEntriesColumns

ERROR_BACKGROUND_BRUSH = <PyQt6.QtGui.QBrush object>
show_tool_tip

A pyqtSignal emitted by instances of the class.

basisChanged

A pyqtSignal emitted by instances of the class.

theoryChanged

A pyqtSignal emitted by instances of the class.

ERROR_PRE = "<span style='color:red'>"
ERROR_POST = '</span>'
ROW_CLASS

alias of ProjEntry

STANDARD_COLUMNS = {0, 1, 2}
QSM_MAX = 99
__init__(parent)
setPerAtomBasisModel(per_atom_basis_model)

Connect this model to the per-atom basis set model from the Basis Set sub-tab.

Parameters:

per_atom_basis_model (schrodinger.application.jaguar.gui.tabs. sub_tab_widgets.basis_set_widgets.BasisSetModel) – The per-atom basis set model

perAtomBasisChanged(eid)

Respond to the user changing a per-atom basis set for the specified entry ID. A per-atom basis set change could change the validity of the current basis set for the structure, so we emit dataChanged. This triggers the view to re-color the background of the cell.

Parameters:

eid (str) – The entry ID

projectUpdated()

Update the table when the project is updated

workspaceChanged(what_changed)

If the workspace changed, update data in case the user changed the charge of a molecule.

Parameters:

what_changed (str) – A flag indicating what changed in the workspace

Note:

This function is called before the workspace changes have propagated to the project table. As such, we use a QTimer to wait until after the changes have propagated before updating.

clearRows()

Clear all row data

rowCount(self, parent: QModelIndex = QModelIndex()) int
columnCount(self, parent: QModelIndex = QModelIndex()) int
data(self, index: QModelIndex, role: int = Qt.DisplayRole) Any
copyChargeMultBasisFromModel(copy_model)

Copy the charge, spin and basis set information from the given model to this model.

Parameters:

copy_model (InputEntriesModel) – The model to copy information from

Raises:

RuntimeError – If the rows in the model are not in the same order

headerData(self, section: int, orientation: Qt.Orientation, role: int = Qt.DisplayRole) Any
flags(self, index: QModelIndex) Qt.ItemFlag
setData(index, value, role=ItemDataRole.EditRole)

Set data for the specified index. The spin multiplicity tool tip will be shown if an invalid spin multiplicity is set, or if a charge is set that renders the spin multiplicity invalid. (The tool tip explains that the default spin multiplicity is being used because the user-specifed value is invalid.)

Parameters:
  • index (QtCore.QModelIndex) – The index to modify

  • value – The value to set

  • role (int) – The role to set data for. Must be Qt.EditRole or setting will fail.

Returns:

True if setting succeeded. False if it failed.

Return type:

bool

checkBasisSets()

Make sure that all structure have a valid basis set selected

Returns:

A list of structures with invalid basis sets

Return type:

list

setDefaultBasis(basis)

Set the default basis set

Parameters:

basis (str) – The default basis set

setDefaultTheory(theory)

Set the default theory level/method

Parameters:

theory (str) – The default theory level/method

getStructures()

Get a list of all structures loaded into the table (i.e. all structures selected in the project table) and the associated settings.

Returns:

A list of ProjEntryTuple objects

Return type:

list

reset()

Reset all charge, spin multiplicity, and basis settings

setBasisForRows(indices, new_basis)

Set the basis set to a new value for the specified indices.

Parameters:
  • indices (list(QModelIndex)) – Indices to be set

  • new_basis (Optional[str]) – New basis name, or None to reset to panel default basis.

resetBasisForRows(indices)

Reset the basis set to the default for the specified indices.

Parameters:

indices (list(QModelIndex)) – Indices to be Reset

setTheoryForRows(indices, new_theory)

Reset the method to a new value for the specified indices.

Parameters:
  • indices (list(QModelIndex)) – Indices to be set

  • new_theory (Optional[str]) – New theory value, or None to reset to panel default theory.

resetTheoryForRows(indices)

Reset the method to the default for the specified indices.

Parameters:

indices (list(QModelIndex)) – Indices to be Reset

getCommonBasis(indices=None)

If all structures use the same basis set, return the basis set name. Otherwise, return None.

Note:

The basis set returned here is not guaranteed to be the default basis set. The user may have specified identical per-structure basis sets for all structures.

Parameters:

indices (list(QModelIndex)) – Optional indices specifying a subset of rows

Returns:

The basis set name or None

Return type:

str or NoneType

getCommonMethod(indices=None)

If all structures use the same method, return the method name. Otherwise, return None.

Note:

The method returned here is not guaranteed to be the default method. The user may have specified identical per-structure methods for all structures.

Parameters:

indices (list(QModelIndex)) – Optional indices specifying a subset of rows

Returns:

The method name or None

Return type:

str or NoneType

getCommonTheoryLevel()
Returns:

If all current methods are of the same theory level, return the theory level. Otherwise return None.

Return type:

str or None

chargedStrucsPresent()

Determine if the user has specified any molecular charges

Returns:

True if the user has specified a molecular charge for any molecule. False otherwise.

Return type:

bool

entryTitles()

Get a dictionary of {entry id: entry title} for all selected entries

entryIds()

Get a set of entry ids for all selected entries

getBasisForEid(eid, per_atom_name)

Get the basis set for the specified entry id. If there are per-atom basis sets specified for the structure, the per_atom_name will be returned.

Parameters:
  • eid (str) – The entry id

  • per_atom_name (str) – The name to return if per-atom basis sets are specified

Returns:

The basis set name, or per_atom_name if per-atom basis sets are specified

Return type:

Basis or str

getMethodForEid(eid)

Return the method for the specified entry ID.

Parameters:

eid (int) – Entry ID to get method for.

Returns:

Method for this entry ID.

Return type:

str

setSource(source)

Specify the row source, i.e., included entries or selected entries

Parameters:

source (UseFrom or schrodinger.ui.qt.input_selector.InputSelector class constant that maps to a UseFrom enum) – The row source

source()

Return the row source, i.e., included entries or selected entries

Returns:

The row source

Return type:

UseFrom

usingSelected()

Return True if the tab is set to use selected entries. False if the tab is set to use included entries.

class schrodinger.application.jaguar.gui.input_tab_widgets.InputEntriesProxyModel(parent=None)

Bases: PythonSortProxyModel

The proxy model for sorting the input entries table

Variables:
  • show_tool_tip (QtCore.pyqtSignal) – A signal indicating that the tool tip for the specified cell should explicitly be shown.

  • redraw (QtCore.pyqtSignal) – A signal to request the view to repaint. This shouldn’t be necessary, but the view doesn’t repaint without it.

show_tool_tip

A pyqtSignal emitted by instances of the class.

redraw

A pyqtSignal emitted by instances of the class.

COLUMN = None
SORT_ROLE = 258
setSourceModel(self, sourceModel: Optional[QAbstractItemModel])
property default_basis
property default_theory
promoteShowToolTip(model_index)

When a show_tool_tip signal is received from the model, translate the index and re-emit the signal.

Parameters:

model_index (QtCore.QModelIndex) – The model index

source()

Return the row source, i.e., included entries or selected entries

Returns:

The row source

Return type:

UseFrom

getCommonBasisForRows(indices)

Return the name of the basis selected in the selected rows, or None if the selected rows contain multiple bases.

Parameters:

indices (list(QModelIndex)) – Indices to be Reset

Returns:

The basis set name or None

Return type:

str or NoneType

setBasisForRows(indices, new_basis)

Reset the basis set to the default for the specified indices.

Parameters:
  • indices (list(QModelIndex)) – Indices to be Reset

  • new_basis (str) – New basis value

resetBasisForRows(indices)

Reset the basis set to the default for the specified indices.

Parameters:

indices (list(QModelIndex)) – Indices to be Reset

getCommonTheoryForRows(indices)

Return the name of the theory selected in the selected rows, or None if the selected rows contain multiple theories.

Parameters:

indices (list(QModelIndex)) – Indices to be Reset

Returns:

The theory name or None

Return type:

str or NoneType

setTheoryForRows(indices, new_theory)

Set the method for the specified indices.

Parameters:
  • indices (list(QModelIndex)) – Indices to be Reset

  • new_theory (str) – New theory value

resetTheoryForRows(indices)

Reset the method to the default for the specified indices.

Parameters:

indices (list(QModelIndex)) – Indices to be Reset

class schrodinger.application.jaguar.gui.input_tab_widgets.InputEntriesView(parent)

Bases: ProjTableLikeView

The view for the input entries table

Variables:
  • basisFiltersChanged – Signal emitted when basis set filters are toggled. emits a dict of current filter settings.

  • methodFiltersChanged – Signal emitted when method filters are toggled. emits a dict of current filter settings.

COLUMN

alias of InputEntriesColumns

basisFiltersChanged

A pyqtSignal emitted by instances of the class.

methodFiltersChanged

A pyqtSignal emitted by instances of the class.

__init__(parent)

Instantiate the view, connect the appropriate delegates, and set the selection behavior to mimic the project table.

setDelegates()

Add delegates to the appropriate columns

applyBasisSetFilterSettings(settings)

Apply the specified basis set filter settings to the basis set delegate.

Parameters:

settings (dict) – Basis set filter settings to apply.

applyMethodFilterSettings(settings)

Apply the specified method filter settings to the basis set delegate.

Parameters:

settings (dict) – Method filter settings to apply.

showToolTip(index)

Show the tool tip for the specified index in response to the model emitting a show_tool_tip signal. (Note that this function has nothing to do with tool tips being shown when the user hovers over a cell.)

Parameters:

index (QtCore.QModelIndex) – The index to show the tool tip for

setModel(self, model: Optional[QAbstractItemModel])
contextMenuEvent(self, a0: Optional[QContextMenuEvent])
selectionContainsNonDefaultBasisSets()
Returns:

True if the current selection contains a non-default basis set, False otherwise.

Return type:

bool

resetBasisOfSelectedRows()

Reset the basis set of the currently selected rows.

selectionContainsNonDefaultMethod()
Returns:

True if the current selection contains a non-default theory level, False otherwise.

Return type:

bool

resetTheoryOfSelectedRows()

Reset the theory level of the currently selected rows.

class schrodinger.application.jaguar.gui.input_tab_widgets.CommitMultipleDelegate

Bases: QStyledItemDelegate

A delegate where Ctrl+Enter will cause the value to be committed to all selected rows. Note that the editor must have an index attribute containing the index being edited. (This index is needed for view.commitDataToSelected(). Qt itself uses QAbstractItemViewPrivate.indexForEditor() to retrieve the index. We don’t have access to the QAbstractItemViewPrivate class, though, so we have store the index in the editor instead.)

Variables:

commitDataToSelected (QtCore.pyqtSignal) – Commit the data from the current editor to all selected cells. This signal is emitted with the editor, the current index, and the delegate.

commitDataToSelected

A pyqtSignal emitted by instances of the class.

eventFilter(editor, event)

Handle Ctrl+Enter

class schrodinger.application.jaguar.gui.input_tab_widgets.BlankableSpinBoxDelegate

Bases: CommitMultipleDelegate

A spin box delegate. If the spin box is committed while it is blank, model.setData will be called with a value of None.

createEditor(self, parent: Optional[QWidget], option: QStyleOptionViewItem, index: QModelIndex) Optional[QWidget]
setEditorData(self, editor: Optional[QWidget], index: QModelIndex)
setModelData(self, editor: Optional[QWidget], model: Optional[QAbstractItemModel], index: QModelIndex)
class schrodinger.application.jaguar.gui.input_tab_widgets.BlankableSpinBox(parent, default=0, minimum=-99, maximum=99)

Bases: QSpinBox

A spin box that allows the empty string as an acceptable value

__init__(parent, default=0, minimum=-99, maximum=99)

Initialize the spin box with a usable range from minimum to maximum. minimum-1 is included in the available spinbox range but is used as the sentinel value for empty string.

Parameters:
  • parent (QtWidgets.QWidget) – The Qt parent

  • default (int) – The default value, i.e. what value should we starting counting from if the user clears the spin box and then increments.

  • minimum (int) – The minimum usable value for the spinbox. The spinbox will allow minimum-1, but that is used to indicate a blank value

  • maximum (int) – The maximum value for the spinbox

valueFromText(text)

Convert the specified text to an integer. “” is converted to the spinbox minimum value

Parameters:

text (str) – The text to convert

Returns:

The converted text

Return type:

int

textFromValue(value)

Convert the specified integer to text. The spinbox minimum value is converted to “”.

Parameters:

value (int) – The integer to convert

Returns:

The converted integer

Return type:

str

stepBy(steps)

Increment the value of the spin box by the specified amount. If the spin box contains “” before incrementing, load the default value.

Parameters:

steps (int) – The value to increment the spin box by

validate(input_text, pos)

Is the provided input acceptable? The blank string is considered acceptable.

See PyQt documentation for argument and return value documentation.

value()

Return the current value in the spin box. If the spin box is blank, None is returned.

Returns:

The current value in the spin box

Return type:

int or NoneType

stepEnabled()

Report on whether stepping up and down is allowed. When the spin box is blank, the user can step both up and down. The user cannot step down to the minimum, since that is a sentinel value.

Returns:

A flag indicating whether stepping is allowed

Return type:

int

class schrodinger.application.jaguar.gui.input_tab_widgets.BasisSetDelegate(parent)

Bases: PopUpDelegate

A delegate for selecting a basis set using a BasisSelectorLineEdit. Additionally, Ctrl+Enter will cause the current value to be committed to all selected rows.

Variables:

filtersChanged – Signal emitted when filters are toggled. emits a dict of current filter settings.

filtersChanged

A pyqtSignal emitted by instances of the class.

__init__(parent)
Parameters:
  • parent (PyQt5.QtWidgets.QWidget) – The Qt parent widget

  • pop_up_class (type) – The class of the pop up widget. Should be a subclass of PopUp.

  • enable_accept_multi (bool) – Whether committing data to all selected cells at once is enabled. If True, commitDataToSelected will be emitted when the LineEditWithPopUp emits popUpClosing with ACCEPT_MULTI. If False, commitData will be emitted instead.

setEditorData(self, editor: Optional[QWidget], index: QModelIndex)
applyBasisSetFilterSettings(settings, emit_filters_changed=True)

Apply the specified basis set filter settings to the basis set popup.

Parameters:
  • settings (dict) – Basis set filter settings to apply.

  • emit_filters_changed (bool) – Whether to emit the filtersChanged signal

class schrodinger.application.jaguar.gui.input_tab_widgets.MethodDelegate(parent)

Bases: PopUpDelegate

A delegate for selecting a method. Additionally, Ctrl+Enter will cause the current value to be committed to all selected rows.

Variables:

filtersChanged – Signal emitted when filters are toggled. emits a dict of current filter settings.

filtersChanged

A pyqtSignal emitted by instances of the class.

__init__(parent)
Parameters:
  • parent (PyQt5.QtWidgets.QWidget) – The Qt parent widget

  • pop_up_class (type) – The class of the pop up widget. Should be a subclass of PopUp.

  • enable_accept_multi (bool) – Whether committing data to all selected cells at once is enabled. If True, commitDataToSelected will be emitted when the LineEditWithPopUp emits popUpClosing with ACCEPT_MULTI. If False, commitData will be emitted instead.

applyMethodFilterSettings(settings, emit_filters_changed=True)

Apply the specified method filter settings to the basis set popup.

Parameters:
  • settings (dict) – Method filter settings to apply.

  • emit_filters_changed (bool) – Whether to emit the filtersChanged signal

class schrodinger.application.jaguar.gui.input_tab_widgets.UseFromCombo(parent=None)

Bases: SComboBox

A combo box that allows the user to select the source for the project table: either included entries or selected entries.

__init__(parent=None)

Create an SComboBox object.

Parameters:
  • parent (QWidget) – The parent widget of this SComboBox

  • items (list) – list of items (str) to be added to the ComboBox - see also itemdict.

  • default_item (str) – text of the item to select initially and upon reset

  • default_index (int) – the index of the item to select initially and upon reset. default_item overrides this parameter.

  • command (callable) – The slot to connect to the currentIndexChanged[str] signal. This command will be called when the default item is selected during initialization unless nocall=True.

  • nocall (bool) – True if command should not be called during initialization, False otherwise

  • layout (QLayout) – The layout to place this widget in

  • tip (str) – The tooltip for the combo

  • itemdict (collections.OrderedDict) – An OrderedDictionary with ComboBox items as keys and data as values. The data for the current ComboBox item is returned by the currentData method. If both items and itemdict are given, items are added first.

  • adjust_to_contents (bool) – True if the size adjust policy should be set to “Adjust to contents”

  • min_width (int) – this property holds the minimum number of characters that should fit into the combobox

updateText(proj)

Update the combo box text to reflect the current number of included and selected entries. This method must be called every time there’s a project change.

Parameters:

proj (schrodinger.project.Project) – The Maestro project

removeSelectedEntriesItem()

Removes ‘Selected entries’ item from the menu.

class schrodinger.application.jaguar.gui.input_tab_widgets.TheorySelectorFilterList(parent)

Bases: _FilterListWithoutPopUpMixin, TheorySelectorFilterListPopUp

class schrodinger.application.jaguar.gui.input_tab_widgets.MultiTheorySelectorDialog(*args, **kwargs)

Bases: _BaseMultiSelectorDialog

Modal dialog for changing the theory of multiple selected rows.

Variables:

filtersChanged – Signal emitted when filters are toggled. emits a dict of current filter settings.

filtersChanged

A pyqtSignal emitted by instances of the class.

__init__(*args, **kwargs)
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.

property selection
setSelection(theory)
applyMethodFilterSettings(settings, emit_filters_changed=True)

Apply the specified method filter settings to the basis set popup.

Parameters:
  • settings (dict) – Method filter settings to apply.

  • emit_filters_changed (bool) – Whether to emit the filtersChanged signal

class schrodinger.application.jaguar.gui.input_tab_widgets.BasisSelectorFilterList(parent)

Bases: _FilterListWithoutPopUpMixin, BasisSelectorFilterPopUp

class schrodinger.application.jaguar.gui.input_tab_widgets.MultiBasisSelectorDialog(*args, **kwargs)

Bases: _BaseMultiSelectorDialog

Modal dialog for changing the basis of multiple selected rows.

Variables:

filtersChanged – Signal emitted when filters are toggled. emits a dict of current filter settings.

filtersChanged

A pyqtSignal emitted by instances of the class.

__init__(*args, **kwargs)
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.

property selection
setSelection(basis)
applyBasisSetFilterSettings(settings, emit_filters_changed=True)

Apply the specified basis set filter settings to the basis set popup.

Parameters:
  • settings (dict) – Basis set filter settings to apply.

  • emit_filters_changed (bool) – Whether to emit the filtersChanged signal