Package schrodinger :: Package application :: Package jaguar :: Package gui :: Module utils
[hide private]
[frames] | no frames]

Module utils

Utility functions and classes for the Jaguar GUIs

Classes [hide private]
  JaguarSettingError
An exception indicating that there was an error with the user-specified Jaguar settings
  JaguarSettingWarning
A warning indicating that a user-specified Jaguar settings could not be loaded into the GUI
  EnhancedComboBox
A combo box for use in the Jaguar GUI with several Pythonic enhancements
  PropertiesTableWidget
A QTableWidget for the Properties table on the Properties tab
  WorkspaceInclusionCheckBox
A checkbox that is skinned to look like the Project Table workspace inclusion checkbox.
Functions [hide private]
 
count_num_strucs(input_selector)
Count the number of structures currently specified in the input selector widget.
 
find_key_for_value(mydict, value)
This function finds key corresponding to a given value in a dictionary.
float
validate_le_float_input(widget, msg=None)
This function checks whether a given line edit widget has a valid input.
 
catch_jag_errors(func)
A decorator that will display any JaguarSettingErrors in an error dialog.
bool
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.
 
apply_jaguar_atom_naming(struc)
Apply jaguar unique atom naming to all atoms in the specified structure
int
calculate_num_protons(struc)
Calculate the number of protons in the specified structure
Variables [hide private]
  THEORY_DFT = 'DFT'
  THEORY_HF = 'HF'
  THEORY_LMP2 = 'LMP2'
  MOLECULAR_CHARGE_PROP = 'i_m_Molecular_charge'
  SPIN_MULT_PROP = 'i_m_Spin_multiplicity'
  __package__ = 'schrodinger.application.jaguar.gui'
Function Details [hide private]

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.appframework.JobInputFrame) - The input selector widget

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.

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 widget
  • msg (str) - text of exception error message
Returns: float
valid float number

catch_jag_errors(func)

 

A decorator that will display any JaguarSettingErrors 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.
Decorators:
  • @decorator.decorator

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:
Returns: bool
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.

apply_jaguar_atom_naming(struc)

 

Apply jaguar unique atom naming to all atoms in the specified structure

Parameters:

calculate_num_protons(struc)

 

Calculate the number of protons in the specified structure

Parameters:
Returns: int
The number of protons