schrodinger.maestro_utils.surface_manager.utils module

schrodinger.maestro_utils.surface_manager.utils.compute_common_check_state(surface_items: list[SurfaceItem]) CheckState

Get the common check state of surface items.

Parameters:

surface_items – List of surface items.

Returns:

The common check state if all items match, or Qt.PartiallyChecked if mixed.

Raises:

ValueError – If the surface item list is empty.

schrodinger.maestro_utils.surface_manager.utils.get_text_item(index: QModelIndex) SurfaceItem

Get the text item from the index on the same row.

Parameters:

index – The index of the item.

Returns:

The text item.

schrodinger.maestro_utils.surface_manager.utils.filter_entry_node_indices(indices: list[PyQt6.QtCore.QModelIndex]) list[PyQt6.QtCore.QModelIndex]

Get the entry node indices from the list of indices.

Parameters:

indices – List of indices.

Returns:

List of entry node indices.

schrodinger.maestro_utils.surface_manager.utils.get_check_item_index(index: QModelIndex) QModelIndex

Get the check item index from the index on the same row.

Parameters:

index – The index of the item.

Returns:

The check item.

schrodinger.maestro_utils.surface_manager.utils.is_surface_node_index(index: QModelIndex) bool

Check if the index is a surface node index.

Parameters:

index – The index to check.

Returns:

True if the node at the given index is a surface node, False otherwise.

schrodinger.maestro_utils.surface_manager.utils.is_entry_node_index(index: QModelIndex) bool

Check if the index is an entry node index.

Parameters:

index – The index to check.

Returns:

True if the node at the given index is an entry node, False otherwise.

schrodinger.maestro_utils.surface_manager.utils.setup_base_surface_actions_menu_connections(surface_table: SurfaceTable, menu: BaseSurfaceActionsMenu)

Setup the connections for the base surface actions menu to the surface table.

Parameters:

menu – The base surface actions menu.

schrodinger.maestro_utils.surface_manager.utils.setup_instant_popup_menu(button: QToolButton, menu_class: type[BaseMenu], parent: QWidget) None

Setup a menu with InstantPopup mode for a QToolButton.

Parameters:
  • button – The QToolButton to configure

  • menu_class – The menu class to instantiate

  • parent – Parent widget for the menu

schrodinger.maestro_utils.surface_manager.utils.get_surface_manager_hub()

Returns the SurfaceManagerHub instance.

schrodinger.maestro_utils.surface_manager.utils.is_single_entry(surface_infos: list[SurfaceInfo]) bool

Check if all the surfaces belong to a single entry.

Parameters:

surface_infos – List of SurfaceInfo objects to check.

Returns:

True if all the surfaces have the same entry ID, False otherwise.