schrodinger.application.jaguar.gui.base_panel module

class schrodinger.application.jaguar.gui.base_panel.JaguarConfigDialog(parent, title='', jobname='', checkcommand=None, help_topic='MM_TOPIC_JOB_START_DIALOG', **kw)

Bases: schrodinger.ui.qt.config_dialog.ConfigDialog

Just like ConfigDialog except that new UX is used for OpenMP settings: Instead of option to select threads vs CPUs, now there is a checkbox for limiting the number of subjobs, and a #max subjobs spinbox.

updateOpenMPInfo()

Enable/disable the limit subjobs widgets based on whether the checkbox is checked or not.

getNumCpusToValidate(is_queue=False)

Return the max # CPUs to pass in to validateNumOpenMP()

Is_queue

Ignored

Is_queue

bool

Return type

int

Returns

total number of CPUs

getOpenMPSettings()
Based on Open MP settings, return a tuple of:
  • Maximum number of CPUs to use

  • Number of threads to use (always 0 in this subclass)

  • Maximum number of subjobs to create.

Returns

(#cpus, #threads, #subjobs)

Return type

(int, int, int)

class schrodinger.application.jaguar.gui.base_panel.BaseJaguarPanel(**kwargs)

Bases: schrodinger.ui.qt.appframework2.af2.JobApp

A base class for all Jaguar GUIs. Subclasses should define TABS and TASK_NAME.

Variables
  • TASK_NAME (str) – The name of the panel

  • SHORT_NAME (str) – A shortened version of TASK_NAME. Used in constructing job names.

  • TABS (list) – The list of tabs that a panel should contain. Each tab must be a schrodinger.application.jaguar.gui.tabs.base_tab.BaseTab subclass.

  • INPUT_SUB_TABS (list) – The list of sub-tabs for the Input tab. Only used if TABS contains a subclass of schrodinger.application.jaguar.gui.tabs. input_tab.InputTabWithSubTabs. Each sub-tab must be a schrodinger. application.jaguar.gui.tabs.input_sub_tabs.base_sub_tab.BaseSubTab subclass.

  • EDIT_DLG_CLASS – The edit dialog class to use for the panel. Subclasses may override this to be a subclass of EditDialog.

TASK_NAME = ''
SHORT_NAME = ''
TABS = []
INPUT_SUB_TABS = []
EDIT_DLG_CLASS

alias of schrodinger.application.jaguar.gui.edit_dialog.EditDialog

getTabParentAndLayout()

Get the parent widget for all tabs and layout to place the tabs into.

setPanelOptions()

Define instance variables that specify the creation of the panel.

setup()

Instantiate the tab widget and tabs. Sub-tabs will also be added to the Input tab if necessary.

getTab(tab_class)

Get the tab of the specified class

Parameters

tab_class (type) – The class of the tab to retrieve

launchJaguarJob(jag_input)

Launch the specified job.

Parameters

jag_input (schrodinger.application.jaguar.input.JaguarInput) – A JaguarInput object to run

Returns

A job object for the launched job

Return type

schrodinger.job.jobcontrol.Job

createCmd()

Create the command line for job launching. Note that the input file name will be added in launchJaguarJob.

Note

This function is intended to be overridden in BaseJaguarPanel subclassses that use different command lines. This code should not be moved into launchJaguarJob.

jobnameArg(jobname=None)

Build the command line arguments for passing the job name.

Parameters

jobname (str) – The jobname to use. If not provided the panel jobname will be used

Returns

A list of command line arguments

Return type

list

getNumStructures()

Get the number of structures that this panel is currently representing

reset()

Reset the panel after prompting the user for confirmation

Returns

Returns False if the user does not want to reset. This will prevent AF2 from resetting the input selector.

Return type

bool or NoneType

getConfigDialog()

Get the job configuration dialog

runTabValidation()

Run validation for each tab. If any tab raises an error, immediately switch to that tab and return the error.

checkKeywordsLE()
generateStatus()

Create the status bar message. This function will prepend any Jaguar- specific status bar message before the standard job information. The Jaguar-specific status bar message can be generated by defining generateJaguarStatus().

generateJaguarStatus()

Create a Jaguar-specific status bar message. This function should be defined in any subclass that wishes to modify the status bar message.

Returns

The Jaguar-specific status bar message, or None if no such message is desired.

Return type

str or NoneType

getMmJagKeywords()

Get Jaguar keywords that are specific to this panel and not set in any of the tabs.

Returns

A dictionary of Jaguar keywords

Return type

dict

class schrodinger.application.jaguar.gui.base_panel.StandardStatusMixin

Bases: object

A mixin that will add the standard Jaguar status bar text to a Jaguar panel. Classes that use this mixin must have both a “Theory” tab and a “Molecule” tab with a basis selector.

__init__()

Connect signals so the status bar is updated whenever the user changes the basis or theory level

generateJaguarStatus()

Create the standard Jaguar status bar message, such as “Jaguar: B3LYP / 6-31**, Single Point Energy”

Returns

The Jaguar status bar message

Return type

str

class schrodinger.application.jaguar.gui.base_panel.TaskStatusMixin

Bases: object

A mixin that will add the task name to the status bar text. No specific tabs are required.

generateJaguarStatus()

Create a Jaguar status bar message containing the task name, similar to “Jaguar: pKa”

Returns

The Jaguar status bar message

Return type

str

class schrodinger.application.jaguar.gui.base_panel.PropertiesMixin

Bases: object

A mixin that will send updates the Properties tab whenever the relevant settings in the “Theory” or “Molecule” tab change. Classes that use this mixin must have must have a “Theory” and a “Properties” tab, and must have a “Molecule” tab with a basis selector.

__init__()

Connect a signal from the Theory tab to the Properties tab whenever the theory level is changed

updatePropertiesTab()

Notify the properties tab that the level of theory or basis set has been updated.

class schrodinger.application.jaguar.gui.base_panel.NoInputTabJobMixin

Bases: object

A mixin that will add the standard Jaguar job running and writing behavior. The write option in the gear menu will use a custom dialog box that allows the user to select between writing a .bat or an .in file.

updateAndCheckMmJag()

Update and validate self._jag_input, the schrodinger.application.jaguar.input.JaguarInput object containing the settings for the input file.

start()

Launch the job. Note that updateAndCheckMmJag must be run before this function to update and validate self._jag_input.

Returns

A job object for the launched job

Return type

schrodinger.job.jobcontrol.Job

class schrodinger.application.jaguar.gui.base_panel.ReadEditMixin

Bases: object

A mixin for panels that should include Read… and Edit… in the gear menu

setup()
getJaguarInputFromFile(filename)

Get the JaguarInput and WorkflowInput object created from the given input file

Parameters

filename (str) – The name of the input file

Return type

(JaguarInput, WorkflowInput or None)

Returns

The first return value is the JaguarInput object if the file can be processed. The second return value is the WorkflowInput object if the input file is for a Jaguar workflow that supports these objects, otherwise it is None.

Raises

mmcheck.MmException – If the file can’t be processed

read(allowed_options=None)

Read in the user-specified Jaguar input file and apply it’s settings to the panel.

Parameters

allowed_options (list) – list of allowed options for the Read dialog. Items of the list should be keys in the schrodinger.jaguar.gui.filedialog.ReadFileDialog.OPTION_TEXT dictionary.

editInput()

Display the edit dialog

jagInputEdited(jag_input, new_struc_flag)

Process the Jaguar settings that the user entered in the Edit dialog.

Parameters
  • jag_input (schrodinger.application.jaguar.input.JaguarInput) – The Jaguar settings from the Edit dialog

  • new_struc_flag (int) –

    A flag indicating whether the structure in jag_input object should be loaded into the workspace. The flag must be one of:

    • EditDialog.SAME_STRUCTURE: The workspace was not changed by the Edit dialog and does not need to be changed.

    • NEW_STRUCTURE: The structure in jag_input is new and should be loaded into the workspace.

    • RELOAD_STRUCTURE: The structure in jag_input is not new, but the Edit dialog changed the workspace, so the workspace should be restored to its previous state.

restorePreviouslyIncludedEntry()

Restore the workspace to it’s previous state if the Edit dialog didn’t change the structure but did clear the workspace via a Preview.

Returns

A tuple of:

  • The entry id of the previously included entry, or None if there wasn’t one

  • The title of the previously included entry, or None if there wasn’t one

Return type

tuple

runEditedInput(jag_input)

Run a job using the JaguarInput file created in the Edit dialog.

Parameters

jag_input (schrodinger.application.jaguar.input.JaguarInput) – The JaguarInput object to run

class schrodinger.application.jaguar.gui.base_panel.MultiStructureMixin

Bases: object

A mixin for panels that contain a MultiStructureTab. Note that this mixin assumes that the ReadEditMixin is present, and MultiStructureMixin must be listed before ReadEditMixin in the class declaration.

setPanelOptions()

Remove the input selector

setup()
projectUpdated()
useParallelArg()
editInput()

Override the ReadEditMixin function to display the edit dialog. Since we have no input selector, the checks present in ReadEditMixin.editInput() are not necessary here (and would lead to tracebacks).

class schrodinger.application.jaguar.gui.base_panel.InputTabMixin

Bases: object

A mixin for panels that use the Input tab. This mixin removes the input selector and keeps the selected structures table up to date. Note that this mixin must appear on the inheritance list before ReadEditMixin.

setPanelOptions()

Remove the input selector

setup()

Store a reference to the input tab and make sure that data from table delegates is commited when the gear menu is accessed

projectUpdated()

Update the table whenever the project updates

workspaceChanged(what_changed)

Update the table whenever the workspace changes in case the user changed the charge of a molecule.

Parameters

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

getTheoryAndSpinData(eid)

Get keywords related to the theory and spin for a structure.

Parameters

eid (int) – Entry ID to get theory and spin settings for

Return type

(str, dict, utils.SpinTreatment, dict)

Returns

method, Dictionary of theory related keywords, the spin treatment, and a dictionary of spin-related keywords

class schrodinger.application.jaguar.gui.base_panel.InputTabJobMixin

Bases: schrodinger.application.jaguar.gui.base_panel.InputTabMixin

A mixin for panels that use the Input tab and launch “standard” Jaguar jobs (i.e. one .in file per structure). Implies InputTabMixin. Note that this mixin must appear on the inheritance list before ReadEditMixin.

start()

Launch the job. Note that _getGeneralSettings must be run before this function to update and validate self._jag_input.

Returns

A job object for the launched job

Return type

schrodinger.job.jobcontrol.Job

getNumStructures()
class schrodinger.application.jaguar.gui.base_panel.InputMultiplicityMixin

Bases: object

Base class for any mixin that needs to get list of entries with spin multiplicities greater than one. It defines input tab and provides function that returns list of names for the entries that have spin multiplicity greater than one.

setup()

Initialize mixin.

class schrodinger.application.jaguar.gui.base_panel.PropertiesValidatorMixin

Bases: schrodinger.application.jaguar.gui.base_panel.InputMultiplicityMixin

A mixin that verifies that all selected properties can be calculated for the input entries. The check is done for certain properties that can not be calculated for entries with spin multiplicity > 1. Classes that use this mixin must have both “Input” and “Properties” tabs.

setup()

Initialize Mixin.

checkMultiplicityProperty()

This function creates a list of entries for which some properties can not be calculated. A warning message is presented that shows both entry names and a list of offending properties.

Returns

True if all calculations can be run, otherwise returns a tuple that contains False and a string with informative message.

Return type

bool or tuple

class schrodinger.application.jaguar.gui.base_panel.ExcitedStateValidatorMixin

Bases: schrodinger.application.jaguar.gui.base_panel.InputMultiplicityMixin

A mixin that verifies that there are no input structures with spin multiplicity greater than one when excited state toggle is set in theory tab. Classes that use this mixin must have both “Input” and “Theory” tabs.

setup()

Initialize Mixin.

checkMultiplicity()

When excited state toggle is checked in theory tab, construct list of entries with spin multiplicity greater than one. If such entries are found a warning message is presented that shows their names.

Returns

True if all calculations can be run, otherwise returns a tuple that contains False and a string with informative message.

Return type

bool or tuple

class schrodinger.application.jaguar.gui.base_panel.UseConsistentOrbitalsMixin

Bases: object

A mixin for panels where the SCF tab contains a “Use consistent orbitals” checkbox. Note that this mixin requires InputTabJobMixin and that UseConsistentOrbitalsMixin must appear before InputTabJobMixin in the inheritance list. This mixin also requires panels to have a ProvidesTheoryMixin tab (typically the Input tab) and a Theory tab.

setup()
start()

Launch the job. If the following criteria are met, canonical.py will be used to run the job:

  • The “Use consistent orbitals” checkbox is checked.

  • There are multiple structures selected

  • All structures have the same basis set

Otherwise, the job will be run as a standard Jaguar job (i.e. jaguar run). Also note that _getGeneralSettings must be run before this function to update and validate self._jag_input.

Returns

A job object for the launched job

Return type

schrodinger.job.jobcontrol.Job

class schrodinger.application.jaguar.gui.base_panel.CoordinateDialog(parent, is_scan)

Bases: PyQt6.QtWidgets.QDialog

This dialog allows user to select corrective action when the same coordinate is found in the lists of scans and constraints.

DELETE_CONSTRAINT = 0
DELETE_SCAN = 1
DELETE_BOTH = 2
__init__(parent, is_scan)

Initialize dialog.

Parameters
  • parent (QtCore.QObject) – parent of this dialog.

  • is_scan (bool) – flag coordinate as scan (True) or constraint (False)

display()

Brings up the dialog and waits for the user to close it. Returns the selected option. Returns default option if the user cancels the dialog.

Returns

one of three possible choices (delete constraint, scan or both)

Return type

int

class schrodinger.application.jaguar.gui.base_panel.MarkerMixin

Bases: object

A mixin for panels that want markers displayed only when certain tabs are active. Subclasses must define MARKER_TAB_CLASSES.

Variables
  • MARKER_TAB_CLASSES (list) – A list of tab classes. Markers will only be displayed when a tab on this list is active.

  • MARKER_TABS (list) – A list of tab instances. Markers will only be displayed when a tab on this list is active. Populated from MARKER_TAB_CLASSES.

MARKER_TAB_CLASSES = []
setup()
showAllJaguarMarkers()

Display markers if a marker tab is active. Hide all markers otherwise.

Note

This function is named showAllJaguarMarkers() so it will override the AF2 showAllJaguarMarkers() function. Note that it doesn’t always show all markers.

class schrodinger.application.jaguar.gui.base_panel.CoordinateMarkerMixin

Bases: schrodinger.application.jaguar.gui.base_panel.MarkerMixin

A mixin for marking constraints from the Scan or Optimization tabs. Note that this mixin should not be directly applied to a panel. Instead, the OptimizationTabMarkerMixin, ScanTabMarkerMixin, or OptimizationAndScanMixin should be used.

Current limitations:
  • If the user changes the element of an constrained (or scanned) atom, the constraint (or scan) will not be updated.

Variables
  • _selected_eids (set) – A set of entry ids currently selected in the project table. If the selected entries changes, all constraints will be cleared.

  • _selected_eid_atom_total (int or NoneType) – If there is only one entry id in _selected_eids, then _selected_eid_atom_total contains the number of atoms in that entry. If the number of atoms changes, all constraints will be cleared. If _selected_eids is empty of contains more than one entry id, then _selected_eid_atom_total is None.

setup()

Initialize self._selected_entries

layOut()

Once setup is complete, properly initialize the selected entries for the Scan and/or Optimization tabs

clearConstraintsIfWorkspace(what_changed)

Check to see if coordinate picking is allowed or if constraints need to be cleared in response to a workspace change. This callback is needed when the user adds or deleted atoms.

Parameters

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

clearConstraintsIfProject()

Check to see if coordinate picking is allowed or if constraints need to be cleared in response to a project table change.

stopPicking()

Stop atom picking in response to changing tabs

class schrodinger.application.jaguar.gui.base_panel.OptimizationTabMarkerMixin

Bases: schrodinger.application.jaguar.gui.base_panel.CoordinateMarkerMixin

A mixin for marking constraints from the Optimization tab

MARKER_TAB_CLASSES = [<class 'schrodinger.application.jaguar.gui.tabs.optimization_tab.OptimizationTab'>]
setup()

Initialize self._selected_entries

class schrodinger.application.jaguar.gui.base_panel.ScanTabMarkerMixin

Bases: schrodinger.application.jaguar.gui.base_panel.CoordinateMarkerMixin

A mixin for marking constraints from the Scan tab

MARKER_TAB_CLASSES = [<class 'schrodinger.application.jaguar.gui.tabs.scan_tab.ScanTab'>]
setup()

Initialize self._selected_entries

class schrodinger.application.jaguar.gui.base_panel.MultiStructurePanelMarkerMixin

Bases: schrodinger.application.jaguar.gui.base_panel.OptimizationTabMarkerMixin, schrodinger.application.jaguar.gui.base_panel.MultiStructureMixin

A mixin for panels that contain a MultiStructureTab and an Optimization Tab. Note that this mixin includes MultiStructureMixin, so that does not need to be added separately. Also note that this mixin assumes that the ReadEditMixin is present, and MultiStructureMixin must be listed before ReadEditMixin in the class declaration.

Current limitations:
  • Markers will only appear on the structure used to define the constraint. (i.e. If a constraint was defined by picking atoms in the transition state structure, markers will only appear on the transition state structure. No markers will appear on the reactant or product structure.)

  • Changing the structures in the Transition State or IRC tab will clear the constraints, even if the user is just selecting an additional structure.

setup()

Initialize self._selected_entries

clearConstraintsIfProject()

Since the MultiStructureTab input is not dependant on the project table, ignore project table changes. (Note that this function overrides the CoordinateMarkerMixin function of the same name.

clearConstraintsIfMultiStrucTab()

If the user changes the structures listed on the MultiStructureTab, clear all constraints. Only allow picking if the listed structures have the same number of atoms and atom names, and only allow picking for the listed structures.

class schrodinger.application.jaguar.gui.base_panel.OptimizationAndScanMixin

Bases: schrodinger.application.jaguar.gui.base_panel.CoordinateMarkerMixin

A mixin that receives updates from Scan and Optimization tabs when new coordinate is added. It then checks whether this coordinate is defined as both scan and constraints coordinate. If this is the case a warning is shown

This mixin also ensures that constraints from both the Scan and Optimization tabs are marked.

Classes that use this mixin must have both “Scan” and “Optimization” tabs.

MARKER_TAB_CLASSES = [<class 'schrodinger.application.jaguar.gui.tabs.optimization_tab.OptimizationTab'>, <class 'schrodinger.application.jaguar.gui.tabs.scan_tab.ScanTab'>]
SCAN = 'scan'
OPTIMIZATION = 'optimization'
setup()

Connect the appropriate signals from Scan and Optimization tabs

checkConstraintCoords(atoms, coordinate_type)

This function checks whether a given coordinate entity already exists in constraint coordinates list. If it is there already a warning message is shown.

checkScanCoords(atoms, coordinate_type)

This function checks whether a given coordinate entity already exists in scan coordinates list. If it is there already a warning message is shown.

resolveCoordsConflict(atoms, coordinate_type, is_scan)

Shows dialog that prompts user to resolve conflict between scan and constraint.

Parameters
  • atoms (list) – list of atom for new coordinate

  • coordinate_type (int) – coordinate type

  • is_scan (bool) – flag coordinate as scan (True) or constraint (False)

showAllJaguarMarkers()

Display the appropriate markers if a marker tab is active. Hide all markers otherwise.

Note

This function is named showAllJaguarMarkers() so it will override the AF2 showAllJaguarMarkers() function. Note that it never actually shows all markers.

stopPicking()

Stop atom picking in response to changing tabs

class schrodinger.application.jaguar.gui.base_panel.SubTabMixin

Bases: object

A mixin for panels that contain an InputTab with sub-tabs. This mixin controls markers and atom picking activation/deactivation. Requires InputTabMixin and must appear before InputTabMixin on the inheritance list.

setup()
deactivateTabs()

Deactivate workspace atom picking in all tabs

showEvent(event)

When the panel is shown, activate workspace atom picking if necessary

See Qt documentation for an explanation of the argument

tabChanged(new_index)

When the tab is changed, activate the newly selected tab

Parameters

new_index (int) – The index of the newly selected tab

showAllJaguarMarkers()

Display only markers for the current sub-tab and apply the sub-tab- specific settings

Note

This function is named showAllJaguarMarkers() so it will override the AF2 showAllJaguarMarkers() function. Note that it doesn’t always show all markers.

addSubTabMarker(atoms, settings, sub_tab_name)

Add a workspace marker for the specified sub-tab. If a marker already exists for the given atoms, sub-tab-specific settings will be added to the marker.

Parameters
  • atoms (list) – A list of atoms to add the marker for

  • settings (dict) – The marker settings

  • sub_tab_name (str) – The name of the sub-tab that the marker is for

removeSubTabMarker(atoms, sub_tab_name)

Delete a workspace marker for the specified sub-tab. If the marker applies to other sub-tabs, then only the sub-tab-specific settings for the given sub-tab will be deleted.

Parameters
  • atoms (list) – A list of atoms to remove the marker for

  • sub_tab_name (str) – The name of the sub-tab that the marker is for

setSubTabMarkerHighlighting(atoms, highlight, sub_tab_name)

Change the workspace marker highlighting for the specified marker.

Parameters
  • atoms (list) – A list of atoms to change the highlighting for

  • highlight (bool) – Whether to highlight (True) or unhighlight (False) the specified marker

  • sub_tab_name (str) – The name of the sub-tab that the marker is for

Note

This function assumes that the specified sub-tab is currently active.

projectUpdated()

Make sure that marker visibility is updated after the Input table has updated the included structures so that we can remove markers for structures that have been removed from the panel.

theoryToInput()

When the level of theory changes, pass the new theory level to the Input tab so it can enable or disable the Charge Constraints sub-tab as necessary.

class schrodinger.application.jaguar.gui.base_panel.AutomaticJobnameMixin

Bases: object

A mixin that automatically generates the jobname using the current panel settings. See PANEL-2712 for additional information.

setup()

Search for any tabs that contain jobname-relevant settings and connect signals so that the jobname updates when the appropriate settings change.

setPanelOptions()
jobnameData()
onMethodChanged()

Perform any needed cross-tab updates based on the current method changing

class schrodinger.application.jaguar.gui.base_panel.StandardPanel

Bases: schrodinger.application.jaguar.gui.base_panel.AutomaticJobnameMixin, schrodinger.application.jaguar.gui.base_panel.InputTabJobMixin, schrodinger.application.jaguar.gui.base_panel.StandardStatusMixin, schrodinger.application.jaguar.gui.base_panel.PropertiesMixin, schrodinger.application.jaguar.gui.base_panel.ReadEditMixin, schrodinger.application.jaguar.gui.base_panel.PropertiesValidatorMixin, schrodinger.application.jaguar.gui.base_panel.ExcitedStateValidatorMixin, schrodinger.application.jaguar.gui.base_panel.BaseJaguarPanel

A convenience class for standard Jaguar panels that:
  • Use the standard status bar message

  • Contain a Theory tab, a Propertiy tab, and an Input tab with a basis selector

  • Have Read… and Edit… options in the gear menu

class schrodinger.application.jaguar.gui.base_panel.StandardPanelNoInputTab

Bases: schrodinger.application.jaguar.gui.base_panel.StandardStatusMixin, schrodinger.application.jaguar.gui.base_panel.PropertiesMixin, schrodinger.application.jaguar.gui.base_panel.ReadEditMixin, schrodinger.application.jaguar.gui.base_panel.NoInputTabJobMixin, schrodinger.application.jaguar.gui.base_panel.BaseJaguarPanel

A convenience class for standard Jaguar panels that use a “Molecule” tab (with a basis selector) in place of an “Input” tab.

class schrodinger.application.jaguar.gui.base_panel.MultiStructurePanel

Bases: schrodinger.application.jaguar.gui.base_panel.AutomaticJobnameMixin, schrodinger.application.jaguar.gui.base_panel.MultiStructurePanelMarkerMixin, schrodinger.application.jaguar.gui.base_panel.StandardPanelNoInputTab

A convenience class for standard Jaguar panels that use a MultiStructureTab.