schrodinger.application.jaguar.gui.basis_selector module

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 to `setInputSelector`(). Alternatively, this widget may be used without an input selector by passing new structures to `structureChanged`().

ENABLE_WHEN_NO_STRUC = False
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.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.

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.

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
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
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.
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.
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
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
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
class schrodinger.application.jaguar.gui.basis_selector.UpperCaseValidator

Bases: PyQt5.QtGui.QValidator

A QValidator that converts all input to uppercase

validate(text, pos)

See PyQt documentation for argument and return value documentation

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.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 structure
  • per_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 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.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 structure
  • per_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 atom `atom_num`(int)

  • Are pseudospectral grids available for the specified structure or atom (bool)

Return type:

tuple

Note:

Either per_atom or atom_num may be given (or neither), but not both.