schrodinger.application.jaguar.gui.input_tab_widgets module¶
-
class
schrodinger.application.jaguar.gui.input_tab_widgets.
Basis
¶ Bases:
schrodinger.application.jaguar.gui.input_tab_widgets.Basis
Class for representing a basis set. The basis set name, polarization (i.e. *’s), and diffuse (i.e. +’s) are stored separately.
-
class
schrodinger.application.jaguar.gui.input_tab_widgets.
BasisSetDelegate
(parent)¶ Bases:
schrodinger.ui.qt.pop_up_widgets.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.
-
setEditorData
(editor, index)¶
-
-
class
schrodinger.application.jaguar.gui.input_tab_widgets.
BlankableSpinBox
(parent, default=0)¶ Bases:
PyQt5.QtWidgets.QSpinBox
A spin box that allows the empty string as an acceptable value
-
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
-
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
-
textFromValue
(value)¶ Convert the specified integer to text. -100 is converted to “”.
Parameters: value (int) – The integer to convert Returns: The converted integer Return type: str
-
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
-
-
class
schrodinger.application.jaguar.gui.input_tab_widgets.
BlankableSpinBoxDelegate
¶ Bases:
schrodinger.application.jaguar.gui.input_tab_widgets.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
(parent, option, index)¶
-
setEditorData
(editor, index)¶
-
setModelData
(editor, model, index)¶
-
-
class
schrodinger.application.jaguar.gui.input_tab_widgets.
CommitMultipleDelegate
¶ Bases:
PyQt5.QtWidgets.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 ( PyQt5.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
¶
-
eventFilter
(editor, event)¶ Handle Ctrl+Enter
-
-
class
schrodinger.application.jaguar.gui.input_tab_widgets.
InputEntriesColumns
¶ Bases:
object
Column constants for the selected entries table
-
BASIS
= 5¶
-
CHARGE
= 3¶
-
HEADERS
= ['ID', 'In', 'Entry Title', 'Charge', 'Spin Mult.', 'Basis Set']¶
-
ID
= 0¶
-
INCLUSION
= 1¶
-
NUM_COLS
= 6¶
-
SPIN_MULT
= 4¶
-
TITLE
= 2¶
-
-
class
schrodinger.application.jaguar.gui.input_tab_widgets.
InputEntriesModel
(parent)¶ Bases:
PyQt5.QtCore.QAbstractTableModel
The data model for the input entries table
Variables: - ERROR_BACKGROUND_BRUSH (
PyQt5.QtGui.QBrush
) – The brush used to paint the background of cells containing invalid data - show_tool_tip (
PyQt5.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.
-
COLUMN
¶ alias of
InputEntriesColumns
-
ERROR_BACKGROUND_BRUSH
= <PyQt5.QtGui.QBrush object>¶
-
ERROR_POST
= '</span>'¶
-
ERROR_PRE
= "<span style='color:red'>"¶
-
basisChanged
¶
-
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
-
checkBasisSets
()¶ Make sure that all structure have a valid basis set selected
Returns: A list of structures with invalid basis sets Return type: list
-
clearRows
()¶ Clear all row data
-
columnCount
(parent=None)¶
-
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 fromRaises: RuntimeError – If the rows in the model are not in the same order
-
data
(index, role=0)¶
-
entryIds
()¶ Get a set of entry ids for all selected entries
-
entryTitles
()¶ Get a dictionary of {entry id: entry title} for all selected entries
-
flags
(index)¶
-
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: Returns: The basis set name, or
per_atom_name
if per-atom basis sets are specifiedReturn type: Basis
or str
-
getCommonBasis
()¶ 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. Returns: The basis set name or None Return type: str or NoneType
-
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
-
headerData
(section, orientation, role=0)¶
-
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
-
reset
()¶ Reset all charge, spin multiplicity, and basis settings
-
rowCount
(parent=None)¶
-
setData
(index, value, role=2)¶ 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 (
PyQt5.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
- index (
-
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
-
setSource
(source)¶ Specify the row source, i.e., included entries or selected entries
Parameters: source ( UseFrom
orschrodinger.ui.qt.input_selector.InputSelector
class constant that maps to a UseFrom enum) – The row source
-
show_tool_tip
¶
-
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.
-
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.
- ERROR_BACKGROUND_BRUSH (
-
class
schrodinger.application.jaguar.gui.input_tab_widgets.
InputEntriesProxyModel
(parent=None)¶ Bases:
schrodinger.ui.qt.table_helper.PythonSortProxyModel
The proxy model for sorting the input entries table
Variables: - show_tool_tip (
PyQt5.QtCore.pyqtSignal
) – A signal indicating that the tool tip for the specified cell should explicitly be shown. - redraw (
PyQt5.QtCore.pyqtSignal
) – A signal to request the view to repaint. This shouldn’t be necessary, but the view doesn’t repaint without it.
-
COLUMN
= None¶
-
SORT_ROLE
= 258¶
-
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 ( PyQt5.QtCore.QModelIndex
) – The model index
-
redraw
¶
-
setSourceModel
(model)¶
-
show_tool_tip
¶
- show_tool_tip (
-
class
schrodinger.application.jaguar.gui.input_tab_widgets.
InputEntriesView
(parent)¶ Bases:
schrodinger.application.jaguar.gui.utils.ProjTableLikeView
The view for the input entries table
-
COLUMN
¶ alias of
InputEntriesColumns
-
contextMenuEvent
(event)¶
-
setModel
(model)¶
-
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 ( PyQt5.QtCore.QModelIndex
) – The index to show the tool tip for
-
-
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
-
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
-
getDefaultSpinMult
()¶ Get the default spin multiplicity on the structure for the current charge
Returns: The default spin multiplicity Return type: int
-
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
-
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
-
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
-
getStructure
()¶ Get the entry structure
Returns: The structure object Return type: schrodinger.structure.Structure
-
reset
()¶ Reset any user-specified settings
-
row_charge
¶ Make sure we provide an up to date row charge value
-
setBasisFromText
(basis)¶ Set the basis
Parameters: basis (str) – The full basis set name including *’s and +’s
-
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)
-
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
-
update
(row)¶ Update this entry with information from the provided row
Parameters: row ( schrodinger.project.ProjectRow
) – The project row
-
-
class
schrodinger.application.jaguar.gui.input_tab_widgets.
ProjEntryTuple
(entry_id, struc, charge, spin_mult, basis)¶ 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
-
-
class
schrodinger.application.jaguar.gui.input_tab_widgets.
UseFrom
¶ Bases:
enum.Enum
-
included
= 1¶
-
selected
= 2¶
-
-
class
schrodinger.application.jaguar.gui.input_tab_widgets.
UseFromCombo
(parent=None)¶ Bases:
schrodinger.ui.qt.swidgets.SComboBox
A combo box that allows the user to select the source for the project table: either included entries or selected entries.
-
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
-