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.

schrodinger.maestro_utils.surface_manager.utils.is_map_file(file_path: str) bool

Check if the given file path corresponds to a recognized map file.

Parameters:

file_path – The file path to check.

Returns:

True if the file is a recognized map file, False otherwise.

schrodinger.maestro_utils.surface_manager.utils.is_standalone_map_import_enabled() bool

Check if the Standalone Map Import feature flag is enabled.

Returns:

True if the feature flag is enabled, False otherwise.

schrodinger.maestro_utils.surface_manager.utils.can_import_as_map(file_path: str) bool

Check if the given file path can be imported as a map.

Parameters:

file_path – The file path to check.

Returns:

True if the map file can be imported, False otherwise.

schrodinger.maestro_utils.surface_manager.utils.safe_lower(name: str | None) str

Helper to return a safe lowercase string for matching.

Parameters:

name – The name to convert to lowercase, or None.

Returns:

Lowercase string or empty string if None.

schrodinger.maestro_utils.surface_manager.utils.get_surface_nodes_from_entry_node(entry_node: EntryNodeItem) list[SurfaceNodeItem]

Get the surface nodes from the entry node.

Parameters:

entry_node – The entry node item.

Returns:

List of surface nodes.

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

Get the surface nodes from given indices.

Parameters:

indices – List of indices.

Returns:

List of surface nodes.

schrodinger.maestro_utils.surface_manager.utils.show_blocked_deletion_warning(blocked_list: list[tuple[SurfaceNodeItem, list[str]]]) None

Show a warning message for surfaces that could not be deleted because their volumes are being used to color other surfaces.

Parameters:

blocked_list – List of (blocked_node, dependent_surface_names) tuples.

schrodinger.maestro_utils.surface_manager.utils.get_blocked_surfaces(surface_nodes: list[SurfaceNodeItem]) list[tuple[SurfaceNodeItem, list[str]]]

Given a batch of surface nodes to delete, return a list of (blocked_node, dependent_surface_names) tuples. A node is blocked if its volume is used to color another surface that is NOT also being deleted in this batch. Builds a reverse map (volume_name -> dependent surface names) in a single pass over all siblings, then checks each deletion candidate via dict lookup.

Parameters:

surface_nodes – Full list of surface nodes in the deletion batch.

Returns:

List of (blocked_node, [dependent_surface_names]) tuples.

schrodinger.maestro_utils.surface_manager.utils.get_all_surface_nodes_from_indices(indices: list[PyQt6.QtCore.QModelIndex]) tuple[list[SurfaceNodeItem], set[int]]

Expand entry node indices to their child surface nodes and collect all surface nodes from the given indices.

Parameters:

indices – List of indices (may include entry or surface nodes).

Returns:

A 2-tuple of (all_surface_nodes, entry_sourced_surface_ids). entry_sourced_surface_ids contains ids of surface nodes that originated from a fully-selected entry node and are therefore exempt from projection dependency checks.