schrodinger.application.livedesign.live_report_widget module

class schrodinger.application.livedesign.live_report_widget.LRSelectionMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: enum.IntEnum

use_existing = 0
add_new = 1
class schrodinger.application.livedesign.live_report_widget.LiveReportType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: enum.Enum

Enumerate the different LD LiveReport types.

COMPOUND = 'compound'
REACTANT = 'reactant'
DEVICE = 'device'
class schrodinger.application.livedesign.live_report_widget.LRInputType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

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

Parameters specifying the destination of the exported data, both LiveDesign server and live report.

lr_user_text: str

Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:

class Coord(CompoundParam):
    x: int
    y: int

An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:

coord = Coord()
coord.x = 4

When a Param value is set, the valueChanged signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:

class Atom(CompoundParam):
    coord: Coord
    element: str
previous_lr_user_text: str

Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:

class Coord(CompoundParam):
    x: int
    y: int

An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:

coord = Coord()
coord.x = 4

When a Param value is set, the valueChanged signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:

class Atom(CompoundParam):
    coord: Coord
    element: str
lr_sort_method: schrodinger.application.livedesign.panel_components.LRSort
lr_input_type: schrodinger.application.livedesign.live_report_widget.LRInputType
lr_selection_mode: schrodinger.application.livedesign.live_report_widget.LRSelectionMode
ld_destinationChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

ld_destinationReplaced

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

lr_input_typeChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

lr_input_typeReplaced

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

lr_selection_modeChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

lr_selection_modeReplaced

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

lr_sort_methodChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

lr_sort_methodReplaced

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

lr_user_textChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

lr_user_textReplaced

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

previous_lr_user_textChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

previous_lr_user_textReplaced

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

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/savedbuilds/2024-4/NB/build-117/internal/lib/python3.11/site-packages/schrodinger/application/livedesign/live_report_widget_ui.py'>
disconnected

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

refreshRequested

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

projectSelected

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

liveReportSelected

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

newLiveReportSelected

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

liveReportDefaultsApplied

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

__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.

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

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

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. And update the visibility of template selector gui components

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, proj_id)

Slot invoked when a project is chosen from combobox.

Parameters
  • proj_name (str) – 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

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