schrodinger.application.livedesign.panel_components module

class schrodinger.application.livedesign.panel_components.AbstractExportTableModel

Bases: schrodinger.ui.qt.table_helper.RowBasedTableModel

Subclasses of this model must define a Column class variable (as described in the table_helper.RowBasedTableModel documentation) which must include the following columns: Assay, Endpoint, Data, Units, Decimal.

ROW_CLASS

alias of ExportRow

disable_lr_columns
Returns:whether to disable certain live report-dependent export columns
Return type:bool
flags(index)

See Qt documentation for an method documentation. Overriding table_helper.RowBasedTableModel.

getEndpointForCurrentAssay(endpoint_index)

Get the appropriate endpoint, if it exists, according to the following order: 1. If the current property name matches one of the endpoints, the

matched endpoint is returned.
  1. If the currently selected endpoint matches one of the endpoints for
    the current assay, the current endpoint itself is returned.
  2. Otherwise, if no assay is currently selected, the default endpoint
    placeholder text is returned.
Parameters:endpoint_index (QtCore.QModelIndex) – the index of the endpoint cell
Returns:matched endpoint or placeholder text
Return type:str
getExportData()

Return a list of ExportData objects corresponding to the items currently selected for export.

Returns:the items currently selected for export
Return type:list(data_classes.ExportData)
getExportDataNoData()

This is a hack to get around the default behavior of the livedesign api. If we provide a property that is not actually found in the structures, it will be skipped by live design. This is currently the only way to upload the structures without any properties, as the default behavior for livedesign uploads ALL the properties if no properties are passed.

Returns:a list containing a single item that will result in no data being uploaded to LiveDesign (only structures)
Return type:list(data_classes.ExportData)
getLRDependentColumns()

Return a list of columns that should be disabled if a live report is not selected in the panel.

Returns:a list of columns that depend on the live report selection
Return type:list of table_helper.TableColumns enum values
getMappableRows()

Get rows that can be saved to a mapping state. Currently this includes only structure property rows.

Returns:mapped row data
Return type:List of ExportRow
isCustomMaestroAssay(assay_index)

Checks if the given assay index is a custom Maestro assay, which is the initial custom assay of ‘Maestro’ selected for Maestro properties, along with the endpoint.

Parameters:assay_index (QtCore.QModelIndex) – the index of the assay cell
Returns:whether the assay holds the initial ‘Maestro’ assay set for maestro properties.
Return type:bool
loadAssayData(assay_paths, favorite_assay_paths)

Load in the complete Assay data - full path name - wrapped as BaseLDTreeItemWrapper

Parameters:
  • assay_paths (List of paths) – Assay data to store.
  • favorite_assay_paths (List of (assay names, folder path) tuples) – Favorite Assay data to store.
loadData(ld_data_list)

Load in the data values to be shown as rows with default information for Assays and Endpoints. Note, this method resets the table.

Parameters:ld_data_list (list(maestro_data_types.LDData)) – list of data values
loadEndpointData(endpoint_names)

Load in all the endpoint names for each Assay.

Parameters:endpoint_names (Dict of key=assay folder path, value=List of str) – Endpoint data to store.
loadMappings(map_rows)

Load in the mapping data. The properties in the mapping data are assumed to already exist in the table. Note, that this method does not reset the table.

Parameters:map_rows (List of ExportRow) – mapped row data to set
Returns:whether the loading of the mapping data was successful
Return type:bool
reset()
class schrodinger.application.livedesign.panel_components.AddNewLineEdit

Bases: PyQt5.QtWidgets.QLineEdit

default_text = ''
focusInEvent(e)
class schrodinger.application.livedesign.panel_components.AssaySelectionLineEdit(parent)

Bases: schrodinger.ui.qt.pop_up_widgets.LineEditWithPopUp

Custom Line Edit to show a Popup (AssaySelectionPopup) when the user clicks on the table cell.

addData(assay_path_data)

Add the assay data to populate the pop up tree model.

Parameters:assay_path_data (List of BaseLDTreeItemWrapper) – the list of tree item wrappers containing the name and path of the assays
addNew(name)

Adds the new Model / Assay name to the table cell and the popup tree.

Parameters:name (str) – new Assay name
assaySelected
getAssayFolderPath()

Return the currently selected assay’s folder path. If no assay is selected, None is returned.

Returns:folder path of currently selected assay.
Return type:str or None
getNewAssay()

Return the newly created assay if one exists.

Returns:the newly created assay
Return type:BaseLDTreeItemWrapper or None
newAssaySelected
onApplyToRowsClicked()

Triggers PopUpDelegate.commitDataToSelected signal

onAssaySelected(item)

Slot connected to tree view’s selection.

Parameters:item (BaseLDTreeItemWrapper) – selected Assay item in the tree view.
setAllAssayData(assays_list, assay_name, assay_folder_path)

Set all the assay data including the list of possible assays, the current (ie last selected) assay name value, and the folder path to the current assay (if exists). This will add the possible assays to the popup’s selection view, set the line edit text, store the assay folder path, and scroll to and select the item corresponding to the current selection in the popup.

Note that because the assay name and path does not currently store whether the original location was from its original path or the ‘Project Favorites’ folder, the selection always scrolls to the original location rather than the ‘Project Favorites’ location.

Parameters:
  • assays_list (List of BaseLDTreeItemWrapper) – the list of ld items specifying the assay names and paths
  • assay_name (str) – the current value of the assay name
  • assay_folder_path (str) – the current value of the assay folder path
setText(text)
class schrodinger.application.livedesign.panel_components.AssaySelectionPopUpDelegate(parent)

Bases: schrodinger.ui.qt.pop_up_widgets.PopUpDelegate

Variables:
  • newAssaySelected (QtCore.pyqtSignal(QtCore.QModelIndex)) – signal emitted when a new assay is created by user and selected for use. This signal is emitted once the assay data is set in the model, and with the assay index.
  • assaySelected (QtCore.pyqtSignal(QtCore.QModelIndex)) – signal emitted when an existing assay is selected and applied. This signal is emitted once the assay data is set in the model, and with the assay index.
assaySelected
newAssaySelected
onAssaySelected()
onNewAssaySelected()
setEditorData(editor, index)
setModelData(editor, model, index)
class schrodinger.application.livedesign.panel_components.AssaySelectionPopup(parent)

Bases: schrodinger.application.livedesign.panel_components.BaseSelectionPopup

A popup for selecting Assays.

newAssaySelected
selectNewAssay()
setDefaultText(text)
setup()
class schrodinger.application.livedesign.panel_components.BaseLDTreeItemWrapper(ld_name, ld_id=None, path='', linked_path=None, show_path=False)

Bases: future.types.newobject.newobject

Simple wrapper for storing either a ld_entities.LiveReport.name or ld_entities.Assay.name, and the folder path used to determine its position in the tree. By building a common wrapper for both items, much of the popup tree item code is simplified.

class schrodinger.application.livedesign.panel_components.BaseLiveReportSelectionPopup(parent)

Bases: schrodinger.application.livedesign.panel_components.BaseSelectionPopup

A BaseSelectionPopup that also has a combo box that can be used to select how Live Report data is organized.

Variables:LRSortMethodChanged (QtCore.pyqtSignal) – signal indicating that a new live report sort method has been chosen; emitted with an LRSort value
LRSortMethodChanged
setupLayout()
setupWidgets(model, view)
class schrodinger.application.livedesign.panel_components.BaseSearchTreeWidgetHelper

Bases: future.types.newobject.newobject

Base class for a widget subclass to hold a search box QLineEdit and a QTreeView below. This is a helper class only and should be sub-classed. This class should NOT be used directly.

resetWidgets()
searchTextChanged(search_text)

Set the search term to the sort filter proxy model to show only the matching tree items. Any filtered in items will be expanded to show all children. Otherwise, all the items will be collapsed.

Parameters:search_text (str) – search terms to apply to proxy model.
setupLayout()

Sets up the layout, but needs to be added to the widget by the subclass.

setupWidgets(model, view)

Sets up the search box, model, view, and search proxy.

Parameters:
  • model (QtGui.QStandardItemModel) – model for the tree
  • view (QtWidgets.QTreeView) – view for the model
class schrodinger.application.livedesign.panel_components.BaseSelectionPopup(parent)

Bases: schrodinger.application.livedesign.panel_components.BaseSearchTreeWidgetHelper, schrodinger.ui.qt.pop_up_widgets.PopUp

Base class for a popup used to selecting either an Assay or Live Report - this class only adds the common widgets and aesthetics to confirm both Popups look identical.

reset()
setup()

Sets up the model, view, proxy and search box.

See BaseSearchTreeWidgetHelper.setupWidgets for more info.

class schrodinger.application.livedesign.panel_components.CascadingCheckboxItem(*args, **kwargs)

Bases: PyQt5.QtGui.QStandardItem

A subclass of QStandardItem that implements checkboxes that automatically respond to changes in child/parent check state. Checking or unchecking an item will cause all of its children to become checked/unchecked accordingly and will update its parent to be either checked, unchecked, or partially checked, depending on the state of all of the other children.

getChildItems(column=0)

Returns a list of all the child items. A column may be optionally specified if desired, otherwise the first column’s item will be returned from each descendent row.

Parameters:column (int) – the column of the item to be returned from each row
setData(value, role)

Overrides setData() to trigger an update of the parent item’s check state and propagate check state to all the child items (i.e. checking this item will cause all its child items to become checked).

See parent class for documentation on parameters.

updateCheckState()

Updates the item’s check state depending on the check state of all the child items. If all the child items are checked or unchecked, this item will be checked/unchecked accordingly. If only some of the children are checked, this item will be partially checked.

class schrodinger.application.livedesign.panel_components.ColumnCheckboxItem(col, force_unavailable=False)

Bases: PyQt5.QtGui.QStandardItem

A CascadingCheckboxItem that stores and knows how to display a Column object.

UNAVAIL_VALUE_TYPES = ['attachment']
column()
class schrodinger.application.livedesign.panel_components.ColumnSelectionListView

Bases: PyQt5.QtWidgets.QListView

A class for displaying a column selection

class schrodinger.application.livedesign.panel_components.ColumnSelectionModel(*args, **kwargs)

Bases: PyQt5.QtGui.QStandardItemModel

A tree structured model for storing data by family.

checkAll(checked=True)

Check all items

getCheckedColumns()

Recursively traverses the entire tree and returns all the checked properties.

Returns:the checked properties
Return type:list of structure.PropertyName
loadData(columns, unavailable_ids=None)

Populates the model using a list of ldclient.models.Column objects. This clears out all previous data in the model.

Parameters:
  • columns (list of ldclient.models.Column) – the list of columns to add
  • unavailable_ids (list of str, or None) – list of column IDs that should always be unavailable for import
onItemChanged(item)

Handle changes in the all button check state.

class schrodinger.application.livedesign.panel_components.ColumnSelectionProxyModel(parent=None)

Bases: PyQt5.QtCore.QSortFilterProxyModel

A proxy model to filter an assay model based on the availability

filterAcceptsRow(source_row, source_parent)

See Qt Documentation for more information on parameters.

This filter accepts a particular row if any of the following are true: 1. The proxy model is currently set to show unavailable items 2. The item is marked as available

Note that the conditions specified above are searched in that order.

showUnavailable(show=True)
class schrodinger.application.livedesign.panel_components.EndpointSelectionLineEdit(parent)

Bases: schrodinger.ui.qt.pop_up_widgets.LineEditWithPopUp

Custom Line Edit to show a Popup (EndpointSelectionPopup) when the user double clicks on the table cell.

addData(endpoint_data)

Add the endpoint data to populate the pop up tree model.

Parameters:endpoint_data (List of str) –
addNew(name)

Slot connected a new Endpoint creation. Add the new Endpoint to the lineedit and the tree.

endpointSelected
newEndpointSelected
onEndpointSelected(item)

Slot connected to tree view’s selection.

Parameters:item (BaseLDTreeItemWrapper) – selected Endpoint item in the tree view.
class schrodinger.application.livedesign.panel_components.EndpointSelectionModel

Bases: schrodinger.application.livedesign.panel_components.LDSelectionModel

data(index, role=0)
flags(index)

Prevent user from selecting endpoints with the ENDPOINT_UNAVAILABLE text. It indicates that the correct endpoint could not be parsed from LiveDesign.

class schrodinger.application.livedesign.panel_components.EndpointSelectionPopUpDelegate(parent)

Bases: schrodinger.ui.qt.pop_up_widgets.PopUpDelegate

setEditorData(editor, index)
class schrodinger.application.livedesign.panel_components.EndpointSelectionPopup(parent)

Bases: schrodinger.application.livedesign.panel_components.BaseSelectionPopup

A popup for selecting Endpoints.

addNewEndpoint()
newEndpointSelected
setup()
class schrodinger.application.livedesign.panel_components.ExportRow(ld_data=None, assay=None, endpoint=None, units=None, decimal=None, assay_folder_path=None)

Bases: future.types.newobject.newobject

An object for data in each row in the table.

class schrodinger.application.livedesign.panel_components.ExportTableView(parent)

Bases: PyQt5.QtWidgets.QTableView

The table view showing all the Properties and Assay / Endpoints. Assay and Endpoint columns are set with different PopUp Delegates to show when the respective column cells are edited.

Column
hideColumns(hide=True)

Show or hide units and decimal places columns from table.

Parameters:hide (bool) – whether to show or hide columns.
onCommitDataToSelected(editor, index, delegate)

Called when “Apply to Selected Rows” is clicked in Assay popup.

See parent class for args documentations.

setModel(model)
class schrodinger.application.livedesign.panel_components.LDDataCheckboxItem(ld_data)

Bases: schrodinger.application.livedesign.panel_components.CascadingCheckboxItem

A CascadingCheckboxItem that stores and knows how to display a maestro_data_types.LDData instance.

ld_data
class schrodinger.application.livedesign.panel_components.LDDataSelectionModel(*args, **kwargs)

Bases: PyQt5.QtGui.QStandardItemModel

A tree structured model for storing LD data by family name.

Variables:item_dict (dict(maestro_data_types.LDData, QtGui.QStandardItem)) – a dictionary mapping LD data to items from this model
clear()
getCheckedData()

Recursively traverses the entire tree and returns LD data instances checked by the user.

Returns:LD data specified for export by the user
Return type:list(maestro_data_types.LDData)
loadData(ld_data_list)

Replaces the data in the model with the specified list of export data.

Parameters:ld_data_list (list(maestro_data_types.LDData)) – a list of LD data to export
setCheckedData(ld_data_list)

Looks through all items in tree and sets the matched values as checked, if found.

Parameters:ld_data_list (list(maestro_data_types.LDData)) – data values to set as checked
uncheckAll()

Un-check all items in tree.

class schrodinger.application.livedesign.panel_components.LDDataSelectionTreeView

Bases: PyQt5.QtWidgets.QTreeView

A class for displaying property selection.

class schrodinger.application.livedesign.panel_components.LDDataSelectionTreeWidget(*args, **kwargs)

Bases: schrodinger.ui.qt.widgetmixins.InitMixin, schrodinger.application.livedesign.panel_components.BaseSearchTreeWidgetHelper, PyQt5.QtWidgets.QWidget

A QWidget with a initialization mixin to group together a search bar LineEdit and the LD Data Selection QTreeView.

dataChanged
getCheckedData()

See LDDataSelectionModel.getCheckedData() for more information.

initLayOut()
initSetDefaults()
initSetUp()

Sets up the model, view, proxy and search box.

See BaseSearchTreeWidgetHelper.setupWidgets for more info.

loadData(ld_data_list)

See LDDataSelectionModel.loadData() for more information.

setCheckedData(ld_data_list)

Check the items corresponding to the supplied LD data (if found), and uncheck all other items.

Parameters:ld_data_list (list(maestro_data_types.LDData)) – a list of LD data instances that should be checked in the tree
uncheckAll()

See LDDataSelectionModel.uncheckAll() for more information.

class schrodinger.application.livedesign.panel_components.LDSelectionModel

Bases: PyQt5.QtGui.QStandardItemModel

Tree model class which stores BaseLDTreeItemWrappers.

flags(index)

Only leaf nodes in the tree model are selectable.

loadData(ld_items)

Load in the generic LiveDesign item and store in Tree form. Note: All previous rows in model are removed.

Parameters:ld_items (List of BaseLDTreeItemWrapper) – an object that holds a name and folder_path attributes.
loadRow(row_data)

Append a single row to the tree model. This method does not clear the model.

Parameters:row_data (str) – text to set for row.
loadRows(row_data)

Load in data and append each data item as a row in Tree. Note: All previous rows in model are removed.

Parameters:row_data (list of str) – text to set for each row.
class schrodinger.application.livedesign.panel_components.LDSelectionTreeView

Bases: PyQt5.QtWidgets.QTreeView

Base class for Selecting an item from a Tree.

itemSelected
scrollToItemWithPath(full_assay_path)

Find the item with the given path, scroll to it, and select it. Useful for making the last selected item visible when a cell is clicked again.

Parameters:full_assay_path (str) – the full path of the assay including the name
selectionChanged(selected, deselected)

See Qt QTreeView for more information.

class schrodinger.application.livedesign.panel_components.LDTreeItem(ld_item)

Bases: PyQt5.QtGui.QStandardItem

A custom Tree item.

class schrodinger.application.livedesign.panel_components.LRSort

Bases: enum.Enum

Folder = 2
Owner = 1
class schrodinger.application.livedesign.panel_components.LRSortCombo(parent=None)

Bases: PyQt5.QtWidgets.QComboBox

Combo box used to specify the method used to sort and organize live reports. Emits a custom signal with an enum designating the sort method.

Variables:LRSortMethodChanged (QtCore.pyqtSignal) – signal indicating that a new live report sort method has been chosen; emitted with an LRSort value
LRSortMethodChanged
onCurrentIndexChanged()

When the user makes a selection in this combo box, emit the enum value associated with their selection (rather than the less-useful index of the selection).

class schrodinger.application.livedesign.panel_components.LiveDesignProjectsCombo(parent=None)

Bases: PyQt5.QtWidgets.QComboBox

This is a standard QComboBox with a few helper methods.

Variables:
  • projectSelected (QtCore.pyqtSignal) – signal for when a any project in the combo box is selected. Emitted with the project name and ID.
  • placeholderSelected (QtCore.pyqtSignal) – signal for when the placeholder in the combo box is selected. Emitted with no arguments.
addProjects(projects)

Resets the combobox and adds the new LD projects in alphabetical order, along with the project id as the user data.

Parameters:projects ([ldclient.models.Project]) – list of LD projects
currentProjectID()

Return the current selected project’s id. If placeholder item is currently selected, None will be returned.

Returns:project id if applicable
Return type:int or None
currentProjectName()

Return the current selected project name or None if no project is selected.

Returns:project name if applicable
Return type:str or None
isPlaceholderItemSelected()

Returns whether the placeholder text is currently selected.

Returns:whether the placeholder is selected.
Return type:bool
placeholderSelected
projectSelected
selectPlaceholderItem()

Simply set the current item to be the placeholder text.

setDefaults()

Resets the combobox and sets the default placeholder entry.

class schrodinger.application.livedesign.panel_components.LiveReportSelectionComboBox(parent, exp_panel, allow_add=True)

Bases: schrodinger.ui.qt.pop_up_widgets.ComboBoxWithPopUp

A custom Combo Box to show a Popup (LiveReportSelectionPopup) when the user clicks on the menu arrow. Also provides a “refresh” button to update the list of live reports from the host.

Variables:
  • liveReportSelected (QtCore.pyqtSignal) – signal emitted when a live report has been chosen in the combo box, with an argument of the live report id.
  • newLiveReportSelected (QtCore.pyqtSignal) – signal emitted when a live report has been created, with an argument of the live report id.
  • LRSortMethodChanged (QtCore.pyqtSignal) – signal indicating that a new live report sort method has been chosen; emitted with an LRSort value
LRSortMethodChanged
addNew()

Slot connected to the ‘Add New Live Report’ button. Generates a new name for the live report depending on any reports selected in the tree and the current date.

liveReportSelected
newLiveReportSelected
onLiveReportSelected(item)

Slot connected to tree view’s selection.

Parameters:item (BaseLDTreeItemWrapper) – selected live report item in the tree view.
reset()

Reset the combo box to initial state.

setData(live_reports)

Load in the live reports to the Tree widget.

Parameters:live_reports (List of BaseLDTreeItemWrapper) – live reports to be added.
class schrodinger.application.livedesign.panel_components.LiveReportSelectionPopup(parent)

Bases: schrodinger.application.livedesign.panel_components.BaseLiveReportSelectionPopup

A popup for selecting Live Reports.

setup()
class schrodinger.application.livedesign.panel_components.LiveReportSelector(parent, exp_panel, allow_add=True)

Bases: schrodinger.ui.qt.widgetmixins.InitMixin, PyQt5.QtWidgets.QWidget

A widget containing a LiveReportSelectionComboBox and a refresh button.

Variables:
  • refreshRequested (QtCore.pyqtSignal) – signals that the user has requested a refresh by clicking on the refresh button
  • liveReportSelected (QtCore.pyqtSignal) – signal emitted when a live report has been chosen in the combo box, with an argument of the live report id.
  • newLiveReportSelected (QtCore.pyqtSignal) – signal emitted when a live report has been created, with an argument of the live report id.
  • LRSortMethodChanged (QtCore.pyqtSignal) – signal indicating that a new live report sort method has been chosen; emitted with an LRSort value
LRSortMethodChanged
initLayOut()
initSetDefaults()
initSetUp()
liveReportSelected
newLiveReportSelected
refreshRequested
setData(live_reports)

Load in the live reports to the Tree widget on the combo box.

Parameters:live_reports (List of BaseLDTreeItemWrapper) – live reports to be added.
class schrodinger.application.livedesign.panel_components.PathTreeDict(paths=None)

Bases: collections.defaultdict

addPath(path)
findPath(path)
class schrodinger.application.livedesign.panel_components.StatusBarDialog

Bases: PyQt5.QtWidgets.QDialog

Helper class to setup the status bar for the panel. This class acts as the parent to avoid thread issues.

class schrodinger.application.livedesign.panel_components.StringSearchFilterProxyModel(parent=None)

Bases: PyQt5.QtCore.QSortFilterProxyModel

A proxy model to filter a tree model to show both parents and children nodes if they match the regular expression string.

filterAcceptsIndex(index)

Checks whether this index’s item should be accepted by the filter. This DFS method checks if either this index’s item’s text or any of its children matches the filter reg exp.

Parameters:index (QtCore.QModelIndex) – the index to filter in or out according to regular exp.
Returns:whether the index should be accepted by the filter
Return type:bool
filterAcceptsParent(index)

Checks whether this index’s item’s text or any of its ancestors matches the filter reg exp.

Parameters:index (QtCore.QModelIndex) – the index to filter in or out according to regular exp.
Returns:whether the index should be accepted by the filter
Return type:bool
filterAcceptsRow(source_row, source_parent)

See Qt Documentation for more information on parameters.

This filter accepts a particular row if any of the following are true: 1. The index’s item’s text matches the reg exp. 2. Any of the index’s children match the reg exp. 3. Any of the index’s parents (up to the root) match the reg exp.

Note that the conditions specified above are searched in that order.

schrodinger.application.livedesign.panel_components.filter_missing_entry(entry, default_value)
schrodinger.application.livedesign.panel_components.make_family_map(ld_data_list)

Given a list of LD data, organize it by family name in a dictionary.

Parameters:ld_data_list (list(maestro_data_types.LDData)) – LD data to organize
Returns:dictionary organizing the supplied LD data by family name
Return type:collections.defaultdict(str, list(maestro_data_types.LDData))
schrodinger.application.livedesign.panel_components.make_ld_item_tree(ld_items)

Makes LD folder/assay(model) tree.

Parameters:ld_items (list of BaseLDTreeItemWrapper) – List of LD items.