schrodinger.application.jaguar.gui.basis_selector module¶
- schrodinger.application.jaguar.gui.basis_selector.num_basis_functions(basis_name, struc, per_atom=None, atom_num=None)¶
Calculate the number of basis functions for the specified structure or atom.
- Parameters
basis_name (str) – The basis name including stars and pluses
struc (
schrodinger.structure.Structure
) – The structureper_atom (dict or NoneType) – An optional dictionary of {atom index: basis name} for per-atom basis sets
atom_num (int or NoneType) – The atom index in
struc
to calculate the number of basis functions for. If given, the number of basis functions will be calculated for a single atom. If not given, the number of basis functions will be calculated for the entire structure.
- Returns
A tuple of:
The number of basis functions for
struc
(if atom_num is not given) or for atomatom_num
(int)Are pseudospectral grids available for the specified structure or atom (bool)
- Return type
tuple
- Note
Either
per_atom
oratom_num
may be given (or neither), but not both.
- schrodinger.application.jaguar.gui.basis_selector.generate_description(basis_name, struc, per_atom=None, atom_num=None)¶
Return a description of the specified basis set applied to the given structure or atom.
- Parameters
basis_name (str) – The basis set name
struc (
schrodinger.structure.Structure
) – The structureper_atom (dict or NoneType) – An optional dictionary of {atom index: basis name} for per-atom basis sets
atom_num (int or NoneType) – The atom index in
struc
to calculate the number of basis functions for. If given, the number of basis functions will be calculated for a single atom. If not given, the number of basis functions will be calculated for the entire structure. Also controls use of NO_PS_MSG vs NO_PS_MSG_ATOMIC.
- Returns
A list of four sentences describing the basis set. If a sentence does not apply to the basis set/structure combination, that location in the list will be None.
- Return type
list
- schrodinger.application.jaguar.gui.basis_selector.combine_sentences(sentences)¶
Given a list of sentences, combine all non-None sentences.
- Parameters
sentences (list) – A list of sentences, where each sentence is either a string ending in a punctuation mark or None
- Returns
The combined sentences
- Return type
str
- schrodinger.application.jaguar.gui.basis_selector.get_basis_display_name(basis)¶
Return the display name for the specified basis.
- Parameters
basis (str) – Basis set to get the display name for.
- Returns
The display name for this basis
- Return type
str
- schrodinger.application.jaguar.gui.basis_selector.get_basis_set_list_items()¶
- Returns
tuple of basis set list items
- Return type
tuple(BasisSetListWidgetItem)
- class schrodinger.application.jaguar.gui.basis_selector.BasisSelectorLineEdit(parent)¶
Bases:
schrodinger.ui.qt.pop_up_widgets.LineEditWithPopUp
A line edit that can be used to select a basis set. A basis selector pop up will appear whenever this line edit has focus.
- __init__(parent)¶
- Parameters
parent (
PyQt5.QtWidgets.QWidget
) – The Qt parent widgetpop_up_class (type) – The class of the pop up widget. Should be a subclass of
PopUp
.
- setBlankBasisAllowed(allowed)¶
Specify whether a blank basis set is allowed or should result in an “Invalid basis set” warning and a red outline around the line edit.
- Parameters
allowed (bool) – True if a blank basis set should be allowed. False if a blank basis set should result in a warning.
- textUpdated(text)¶
Whenever the text in the line edit is changed, update the pop up and the red error outline
- Parameters
text (str) – The current text in the line edit
- popUpUpdated(basis_name)¶
Whenever the basis selected in the pop up is changed, update the line edit.
- Parameters
basis_name (str) – The basis selected in the pop up
- setStructure(struc)¶
Set the structure to use for determining basis set information and availability
- Parameters
struc (
schrodinger.structure.Structure
) – The structure to use
- setStructureAndUpdateBorder(struct)¶
Set the structure and update the edit border to show whether the current basis set is valid for the structure or not
- Parameters
struct (
schrodinger.structure.Structure
) – The structure to use
- setAtomNum(atom_num)¶
Set the atom number. The basis selector will now allow the user to select a basis set for the specified atom rather than for the entire structure. Note that this function will clear any per-atom basis sets that have been set via
setPerAtom
.- Parameters
atom_num (int) – The atom index
- setPerAtom(per_atom)¶
Set the atom number. The basis selector will now allow the user to select a basis set for the specified atom rather than for the entire structure. Note that this function will clear any per-atom basis sets that have been set via
setPerAtom
.- Parameters
atom_num (int) – The atom index
- setBasis(basis)¶
Set the basis to the requested value.
- Parameters
basis_full (str or NoneType) – The requested basis. Note that this name may include
*
’s and+
’s.- Raises
ValueError – If the requested basis was not valid. In these cases, the basis set will not be changed.
- hasAcceptableInput()¶
Return True if a basis set has been specified. False otherwise.
- isValid()¶
Return True if a basis set has been specified and the basis set applies to the current structure. False otherwise.
- class schrodinger.application.jaguar.gui.basis_selector.UpperCaseValidator¶
Bases:
PyQt6.QtGui.QValidator
A QValidator that converts all input to uppercase
- validate(text, pos)¶
See PyQt documentation for argument and return value documentation
- class schrodinger.application.jaguar.gui.basis_selector.BasisSelector(parent=None, input_selector=None)¶
Bases:
schrodinger.application.jaguar.gui.basis_selector._BasisSelectorPopUp
A widget for selecting a Jaguar basis set without a line edit.
BasisSelectorLineEdit should be favored over this class for new panels. This widget may be directly connected to a
schrodinger.ui.qt.input_selector.InputSelector
instance by passing it to the initializer or tosetInputSelector
. Alternatively, this widget may be used without an input selector by passing new structures tostructureChanged
.- ENABLE_WHEN_NO_STRUC = False¶
- __init__(parent=None, input_selector=None)¶
- setInputSelector(input_selector)¶
Set the input selector that this widget should respond to
- Parameters
input_selector (
schrodinger.ui.qt.input_selector.InputSelector
) – The AppFramework input selector frame
- structureChanged(new_struc)¶
React to the user changing the selected structure by updating or disabling the basis selection.
- Parameters
new_struc (
schrodinger.structure.Structure
) – The new structure
- class schrodinger.application.jaguar.gui.basis_selector.BasisSetListWidgetItem(text, full_name=None, is_diffuse=False, is_pseudospectral=False, is_ecp=False, is_relativistic=False, is_rimp2_compatible=False)¶
Bases:
PyQt6.QtWidgets.QListWidgetItem
Custom QListWidgetItem that is associated with a specific basis set.
- __init__(text, full_name=None, is_diffuse=False, is_pseudospectral=False, is_ecp=False, is_relativistic=False, is_rimp2_compatible=False)¶
- Parameters
text (str) – Text for this list item.
full_name (str or None) – Full name for the basis set. If not specified, the value of text will be used.
is_diffuse (bool) – Whether this basis set is diffuse.
is_pseudospectral (bool) – Whether this basis set is pseudospectral.
is_ecp (bool) – Whether this basis set is ECP.
is_relativistic (bool) – Whether this basis set is relativistic.
is_rimp2_compatible (bool) – Whether this basis set has an automatically associated rimp2_auxbas
- class schrodinger.application.jaguar.gui.basis_selector.BasisSelectorFilterPopUp(parent)¶
Bases:
schrodinger.ui.qt.filter_list.FilterListPopUp
A pop up widget that allows for dynamic filtering and selection of basis sets.
- __init__(parent)¶
- Parameters
parent (QtWidgets.QWidget) – The parent widget.
- setStructure(new_struc)¶
React to the user changing the selected structure by updating or disabling the basis selection.
- Parameters
new_struc (schrodinger.structure.Structure or None) – The new structure or None to clear structure.
- setPerAtom(per_atom)¶
Set the per-atom basis sets for the current structure. These basis sets will be used when calculating the available basis sets and the number of basis functions. Note that this function will clear any atom number that has been set via
setAtomNum
.- Parameters
per_atom (dict) – A dictionary of {atom index: basis name} for per-atom basis sets.
- setAtomNum(atom_num)¶
Set the atom number. The basis selector will now allow the user to select a basis set for the specified atom rather than for the entire structure. Note that this function will clear any per-atom basis sets that have been set via
setPerAtom
.- Parameters
atom_num (int) – The atom index
- structureUpdated()¶
React to a change in the structure described by self._struc. i.e. The
schrodinger.structure.Structure
object passed tosetStructure
has not changed, but the structure described by that object has.
- isValid()¶
Is a valid basis currently selected?
- Returns
True is a valid basis is currently selected. False otherwise.
- Return type
bool
- getBasis()¶
Get the currently selected basis
- Returns
The currently selected basis or None if no basis is selected.
- Return type
str or None
- setBasis(basis_full=None)¶
Set the basis to the requested value. If no value is given, the default basis (6-31G**) will be used.
- Parameters
basis_full (str or NoneType) – The requested basis. Note that this name may include
*
’s and+
’s. If None is passed the default will be used.- Raises
ValueError – If the requested basis was not valid. In these cases, the basis set will not be changed and basis_changed will not be emitted.
- setBasisSafe(basis_full='')¶
Set the basis to the requested value. If the provided basis name is invalid, then the combo boxes will be cleared. (With setBasis(), an exception is raised if the basis name is invalid.)
- Parameters
basis_full (str) – The requested basis set name including any
*
’s and+
’s.- Returns
True if the basis was valid. False otherwise.
- Return type
bool
- basisModel()¶
Return the model of basis set names
- Returns
The model of basis set names
- Return type
PyQt5.QtCore.QAbstractItemModel
- setNoStrucAllowed(allow_no_struc)¶
Set whether a structure must be set on this popup.
- Parameters
allow_no_struc (bool) – Whether a structure must be set or not.
- setBlankBasisAllowed(allowed)¶
Specify whether a blank basis set is allowed
- Parameters
allowed (bool) – True if a blank basis set should be allowed
- hasAcceptableInput()¶
Return True if the current basis set is valid, False otherwise.
- Return type
bool
- class schrodinger.application.jaguar.gui.basis_selector.BasisSelectorFilterListToolButton(parent)¶
Bases:
schrodinger.ui.qt.filter_list.ToolButtonWithFilterListPopUp
Custom tool button with a basis selector filter list pop up.
- POP_UP_CLASS¶
alias of
schrodinger.application.jaguar.gui.basis_selector.BasisSelectorFilterPopUp
- getBasis()¶
- setBasis(basis)¶
- hasAcceptableInput()¶
Return True if a valid basis set has been specified. False otherwise.
- setStructure(struct)¶
Set the structure on the popup.
- Parameters
struct (schrodinger.structure.Structure or None) – Structure to be set, or None to unset a structure.
- applySettings(settings)¶
Apply the specified filter settings to the pop up
- Parameters
settings (dict) – Settings to be applied
- class schrodinger.application.jaguar.gui.basis_selector.FilterBasisSelectorReadOnlyLineEdit(parent)¶
Bases:
schrodinger.ui.qt.pop_up_widgets.LineEditWithPopUp
A read-only line edit used as an editor for table models with a BasisSelectorFilterPopUp.
- Variables
filtersChanged – Signal emitted when filters are toggled. emits a dict of current filter settings.
- filtersChanged¶
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.
- __init__(parent)¶
- Parameters
parent (
PyQt5.QtWidgets.QWidget
) – The Qt parent widgetpop_up_class (type) – The class of the pop up widget. Should be a subclass of
PopUp
.
- setStructure(struc)¶
Set the structure to use for determining basis set information and availability
- Parameters
struc (
schrodinger.structure.Structure
) – The structure to use
- setAtomNum(atom_num)¶
Set the atom number. The basis selector will now allow the user to select a basis set for the specified atom rather than for the entire structure. Note that this function will clear any per-atom basis sets that have been set via
setPerAtom
.- Parameters
atom_num (int) – The atom index
- setPerAtom(per_atom)¶
Set the atom number. The basis selector will now allow the user to select a basis set for the specified atom rather than for the entire structure. Note that this function will clear any per-atom basis sets that have been set via
setPerAtom
.- Parameters
atom_num (int) – The atom index
- setBasis(basis_full=None)¶
Set the basis to the requested value.
- Parameters
basis_full (str or NoneType) – The requested basis. Note that this name may include
*
’s and+
’s.- Raises
ValueError – If the requested basis was not valid. In these cases, the basis set will not be changed.
- popUpUpdated()¶
Update the text edit’s basis based on the value in the pop up.
- applySettings(settings)¶
Apply the specified filter settings to the pop up.
- Parameters
settings (dict) – Filter settings to apply