schrodinger.ui.qt.standard.controllers.structure_source module

class schrodinger.ui.qt.standard.controllers.structure_source.StructureSource(multiplicity: Multiplicity, empty_message: str, multiple_message: str)

Bases: ABC

Provide and validate structures from one configured input source.

__init__(multiplicity: Multiplicity, empty_message: str, multiple_message: str)
validationErrorMessage() → str | None

Return an error describing invalid input, or None.

abstract structures() → Iterator[Structure]

Return an iterator over a snapshot of the current structures.

abstract countStructures() → int

Return the number of structures supplied by this source.

class schrodinger.ui.qt.standard.controllers.structure_source.PathStructureSource(controller: PathBrowseController, multiplicity: Multiplicity, empty_message: str = 'The selected file does not contain any structures.', multiple_message: str = 'The selected file must contain exactly one structure.')

Bases: StructureSource

Read structures from paths selected by a path browse controller.

__init__(controller: PathBrowseController, multiplicity: Multiplicity, empty_message: str = 'The selected file does not contain any structures.', multiple_message: str = 'The selected file must contain exactly one structure.')
paths() → list[str]

Return the selected paths.

validationErrorMessage() → str | None

Return an error describing invalid path input.

structures() → Iterator[Structure]

Iterate over structures in a snapshot of the selected paths.

countStructures() → int

Return the number of structures in all selected paths.

class schrodinger.ui.qt.standard.controllers.structure_source.ProjectStructureSource(snapshot_provider: Callable[[], EntrySnapshot], multiplicity: Multiplicity, empty_message: str, multiple_message: str, project_row_predicate: collections.abc.Callable[[ProjectRow], bool] | None = None)

Bases: StructureSource

Read structures supplied by a project-entry snapshot provider.

__init__(snapshot_provider: Callable[[], EntrySnapshot], multiplicity: Multiplicity, empty_message: str, multiple_message: str, project_row_predicate: collections.abc.Callable[[ProjectRow], bool] | None = None)
structures() → Iterator[Structure]

Iterate over structures for a snapshot of the project entries.

countStructures() → int

Return the number of current project entries.