schrodinger.application.livedesign.live_report_widget module

class schrodinger.application.livedesign.live_report_widget.LRSelectionMode

Bases: enum.IntEnum

use_existing = 0
add_new = 1
class schrodinger.application.livedesign.live_report_widget.LiveReportType

Bases: enum.Enum

Enumerate the different LD LiveReport types.

COMPOUND = 'compound'
REACTANT = 'reactant'
DEVICE = 'device'
class schrodinger.application.livedesign.live_report_widget.LRInputType

Bases: enum.IntEnum

Enum class corresponding to the options that the user has for selecting a live report. The values assigned to each option corresponds to its index in the input type combo box.

title = 0
id_or_url = 1
class schrodinger.application.livedesign.live_report_widget.SwallowEnterFilter

Bases: PyQt6.QtCore.QObject

eventFilter(widget, event)

Swallow certain key presses so that if the user presses “Return” or “Enter” while widget is in focus, the only result will be that widget loses focus, and the key press event will not be propagated.

Parameters
  • widget (QtWidgets.QWidget) – the widget being watched by this event filter

  • event (QtCore.QEvent) – an event

Returns

True if the event should be ignored, False otherwise

Return type

bool

class schrodinger.application.livedesign.live_report_widget.LiveReportModel(*args, _param_type=<object object>, **kwargs)

Bases: schrodinger.models.parameters.CompoundParam

ld_destination: schrodinger.application.livedesign.export_models.LDDestination

A parameter of the class.

lr_user_text: str

A parameter of the class.

previous_lr_user_text: str

A parameter of the class.

lr_sort_method: schrodinger.application.livedesign.panel_components.LRSort

A parameter of the class.

lr_input_type: schrodinger.application.livedesign.live_report_widget.LRInputType

A parameter of the class.

lr_selection_mode: schrodinger.application.livedesign.live_report_widget.LRSelectionMode

A parameter of the class.

ld_destinationChanged

A pyqtSignal emitted by instances of the class.

ld_destinationReplaced

A pyqtSignal emitted by instances of the class.

lr_input_typeChanged

A pyqtSignal emitted by instances of the class.

lr_input_typeReplaced

A pyqtSignal emitted by instances of the class.

lr_selection_modeChanged

A pyqtSignal emitted by instances of the class.

lr_selection_modeReplaced

A pyqtSignal emitted by instances of the class.

lr_sort_methodChanged

A pyqtSignal emitted by instances of the class.

lr_sort_methodReplaced

A pyqtSignal emitted by instances of the class.

lr_user_textChanged

A pyqtSignal emitted by instances of the class.

lr_user_textReplaced

A pyqtSignal emitted by instances of the class.

previous_lr_user_textChanged

A pyqtSignal emitted by instances of the class.

previous_lr_user_textReplaced

A pyqtSignal emitted by instances of the class.

class schrodinger.application.livedesign.live_report_widget.LiveReportWidget(parent=None, allow_add_live_reports=False)

Bases: schrodinger.models.mappers.MapperMixin, schrodinger.ui.qt.basewidgets.BaseWidget

Compound widget for allowing the user to specify a live report by either
  1. Selecting a project title and live report title (or creating a new

    live report)

  2. Specifying a live report URL

  3. Specifying a live report ID

Variables
  • refreshRequested (QtCore.pyqtSignal) – a signal propagated from the live report selector widget indicating that the user wants the list of available live reports to be refreshed

  • projectSelected (QtCore.pyqtSignal) – a signal emitted when the target project changes

  • liveReportSelected (QtCore.pyqtSignal) – a signal propagated from the live report selector widget indicating that the user has selected an existing live report. Includes the live report’s ID as its argument.

  • newLiveReportSelected (QtCore.pyqtSignal) – a signal propagated from the live report selector widget indicating that the user has decided to create a new live report. Includes the new live report’s name as its argument.

  • liveReportDefaultsApplied (QtCore.pyqtSignal) – a signal indicating that the current live report data has been cleared and replaced by default values.

SHOW_AS_WINDOW = False
model_class

alias of schrodinger.application.livedesign.live_report_widget.LiveReportModel

ui_module = <module 'schrodinger.application.livedesign.live_report_widget_ui' from '/scr/buildbot/builds/core-suite-ci/core-suite-ci/build/internal/lib/python3.11/site-packages/schrodinger/application/livedesign/live_report_widget_ui.py'>
disconnected

A pyqtSignal emitted by instances of the class.

refreshRequested

A pyqtSignal emitted by instances of the class.

projectSelected

A pyqtSignal emitted by instances of the class.

liveReportSelected

A pyqtSignal emitted by instances of the class.

newLiveReportSelected

A pyqtSignal emitted by instances of the class.

liveReportDefaultsApplied

A pyqtSignal emitted by instances of the class.

__init__(parent=None, allow_add_live_reports=False)
initSetUp()

Creates widget from ui and stores it ui_widget.

Suggested subclass use: create and initialize subwidgets, and connect signals.

initLayOut()

@overrides: widgetmixins.InitMixin

initSetDefaults()

Meant to be called when switching between LD input combo box options. Resets data entered into the panel so that the source of the LiveReport will be unambiguous.

initFinalize()

Suggested subclass use: perform any remaining initialization.

currentProjectSelector() schrodinger.application.livedesign.panel_components.LiveDesignProjectsCombo

Return the project selector for the current LR selection mode

defineMappings()

Override this in the subclass to define mappings. Should return a list of tuples [(<target>, <param>)]. Targets can be:

  1. a basic widget, like QLineEdit or QComboBox

  2. a custom object that inherits MapperMixin or TargetMixin

  3. a TargetSpec instance

  4. a slot

For common widgets, standard signals and getter/setter methods will be used, as defined in mappers._get_default_access_names().

For more fine-grained custom control, instantiate a TargetSpec object, which allows custom setters, getters, and signals to be specified.

Supplying a slot as the first element of the tuple is equivalent to providing TargetSpec(slot=my_slot).

Note that all target slots are triggered on setModel() as well as in response to the specified signal.

The param is an abstract param reference, e.g. MyModel.my_param.

Example:

def defineMappings(self):
    combo = self.style_combo
    return [(self.name_le, MyModel.name),
            (TargetSpec(combo,
                    getter=combo.currentText,
                    setter=combo.setCurrentText), MyModel.style),
            (self.coord_widget, MyModel.coord),
            (self._onASLTextChanged, MyModel.asl_text)]
getSignalsAndSlots(model)

Override this method to specify signal and slot pairs that need to be connected/disconnected whenever the model instance is switched using setModel. The model instance is provided as an argument so that instance-specific signals can be used, but any pairs of signals and slots may be returned from this method.

Returns

a list of 2-tuples where each tuple is a signal, slot pair

setTitle(title: str)

Set the title for the LiveReportWidget, which is displayed at the left of the widget like, “Import from LiveReport:”, “Export to:”

Parameters

title – The title to set

restoreSettings(pref_handler: schrodinger.utils.preferences.Preferences)

Restore settings from preferences

Parameters

pref_hander – An instance of preferences.Preferences

Raises

ValueError if the values in preferences could not be restored

saveSettings(pref_handler: schrodinger.utils.preferences.Preferences)

Save settings to Preferences

Parameters

pref_hander – An instance of preferences.Preferences

Raises

ValueError if any value to be saved in missing

setLiveReport(lr_id)

Set the active live report.

Parameters

lr_id (str) – the ID of the desired live report

clearProject()

Clear widget state related to the selected project.

setLiveReportTemplateDefaults()

Clear template id and the template selection combobox

setLiveReportDefaults()

Reset current live report selection and anything that depends on it.

getLiveReportID()
getTemplateID()
getProjectID()
getProjectName()
evaluateLiveReportText()

Evaluate the text in the live report line edit and return the associated project and live report IDs, if possible.

Returns

a 2-tuple containing the project and live report IDs, if they can be found

Return type

tuple(str, str) or tuple(None, None)

refresh()

If the user previously closed the panel with a live report ID or URL specified, re-evaluate the text to extract its live report information.

onProjectSelected(proj_name: str, proj_id: str)

Slot invoked when a project is chosen from combobox.

Parameters
  • proj_name – the selected project name

  • proj_name – the selected project ID

refreshLiveReportSelector()

Refresh project data based on panel state.

loadLiveReports()

Fetch the project’s live reports and load them into the combo box.

Note that template and device LRs are filtered out for LD v8.3+.

onLRSortMethodChanged(sort_value)

Store the selected sort method in response to the user selecting a new LiveReport sort method.

Parameters

sort_value (panel_components.LRSort) – an enum value associated with a sort method

addNewLiveReport()

Generate a new live report name

updateLRSelectionMode(mode: schrodinger.application.livedesign.live_report_widget.LRSelectionMode)

Update the LR selection mode

Parameters

mode – LRSelectionMode to be updated

schrodinger.application.livedesign.live_report_widget.lr_filter(lr)

Filter live reports that do not meet desired criteria.

This includes LRs from LD v8.3+ that have a type attribute marking them as devices.

Parameters

lr (models.LiveReport) – a LiveReport

Returns

whether the LiveReport should be presented to the user

Return type

bool