schrodinger.ui.qt.standard.controllers.structure_input_controller module

exception schrodinger.ui.qt.standard.controllers.structure_input_controller.InvalidStructureInput

Bases: ValueError

Raised when structures are requested from invalid input.

class schrodinger.ui.qt.standard.controllers.structure_input_controller.StructureInputController(*, parent: QWidget, source_combo: QComboBox, path_controller: PathBrowseController | None = None, sources: list[InputSource] | None = None, multiplicities: dict[InputSource, Multiplicity] | None = None, default_source: InputSource | None = None, project_row_predicate: collections.abc.Callable[[ProjectRow], bool] | None = None)

Bases: QObject

Coordinate structure input from paths or Maestro project entries.

This controller owns structure validation and resolution, source multiplicity policy, and path-display visibility. It delegates source selection, path browsing, and project synchronization to private composed controllers and does not create widgets or layouts. Project-backed sources are omitted outside Maestro. Path multiplicity is independent of whether the path controller accepts multiple paths because one file may contain multiple structures.

Variables:
  • sourceChanged – Emitted with the newly active source whenever the source selection changes.

  • inputChanged – Emitted whenever the active source or the input supplied by the active source changes. Changes to inactive sources do not emit this signal.

sourceChanged

A pyqtSignal emitted by instances of the class.

inputChanged

A pyqtSignal emitted by instances of the class.

__init__(*, parent: QWidget, source_combo: QComboBox, path_controller: PathBrowseController | None = None, sources: list[InputSource] | None = None, multiplicities: dict[InputSource, Multiplicity] | None = None, default_source: InputSource | None = None, project_row_predicate: collections.abc.Callable[[ProjectRow], bool] | None = None) → None

Create a structure input controller.

Parameters:
  • parent – Widget that owns this controller and bounds the lifetime and visibility of Maestro project callbacks.

  • source_combo – Combo box used to select the active input source.

  • path_controller – Configured path browse controller. Required exactly when Paths is an available source.

  • sources – Input sources to offer. Defaults to all sources, with project sources omitted outside Maestro.

  • multiplicities – Sparse overrides of the default structure multiplicity for each source.

  • default_source – Initially active source. A project source is ignored as the default outside Maestro.

  • project_row_predicate – Optional predicate used to filter rows supplied by selected- and included-entry sources before structure multiplicity is validated.

sources() → tuple[InputSource, ...]

Return the configured input sources in display order.

source() → InputSource

Return the active input source.

setSource(source: InputSource) → None

Select an enabled input source.

setSourceEnabled(source: InputSource, enabled: bool) → None

Enable or disable an input source.

reset() → None

Restore the default source and clear retained path input.

validationErrorMessage() → str | None

Return the active source’s validation error, if any.

isValid() → bool

Return whether the active source identifies usable input.

structures() → Iterator[Structure]

Return an iterator over structures from the active source.

Raises:

InvalidStructureInput – If the active source is invalid.

countStructures() → int

Return the number of structures from the active source.

Raises:

InvalidStructureInput – If the active source is invalid.