schrodinger.application.models.execution.sources module¶
- class schrodinger.application.models.execution.sources.AbstractRowSource¶
Bases:
object- generateRows() Iterator[dict[str, Any]]¶
Must be implemented in child classes as a generator that yields dicts representing rows, where each dict contains the row data as well as a unique identifier under the key
ROW_SOURCE_ID_KEY.
- getRowSchema() dict[str, type]¶
Returns a dictionary mapping input names to their types for the rows generated by this row source. This is used to infer the schema of the rows.
- class schrodinger.application.models.execution.sources.ListRowSource(rows)¶
Bases:
AbstractRowSourceA row source that reads row dicts from a list, which is supplied at initialization. The list index is used as the unique row identifier.
- __init__(rows)¶
- generateRows()¶
Must be implemented in child classes as a generator that yields dicts representing rows, where each dict contains the row data as well as a unique identifier under the key
ROW_SOURCE_ID_KEY.
- getRowSchema() dict[str, type]¶
Returns the types of the row dicts in the list.
- class schrodinger.application.models.execution.sources.StructureFileRowSource(struct_file, property_map)¶
Bases:
AbstractRowSourceA row source that reads structures from a structure file and yields a row dict for each structure. The index of the structure in the file is used as the unique row identifier.
In addition to the structure filename, a mapping of model input names to structure properties must be specified. A special value
STRUCTUREcan be used as a property to indicate that the structure itself should be included in the row dict under the corresponding input name.- Example mapping:
{‘foo’: ‘s_m_foo’, ‘bar’: ‘i_m_bar’, ‘ligand’: STRUCTURE }
- STRUCTURE = <object object>¶
- __init__(struct_file, property_map)¶
- generateRows()¶
Must be implemented in child classes as a generator that yields dicts representing rows, where each dict contains the row data as well as a unique identifier under the key
ROW_SOURCE_ID_KEY.
- getRowSchema() dict[str, type]¶
Returns a dictionary mapping input names to their types for the rows generated by this row source.
- class schrodinger.application.models.execution.sources.LegacyLDRowSource(input_file_tuples: list[tuple[ColumnInput, str]])¶
Bases:
AbstractRowSourceA row source that reads column input data from CSV files as created by the legacy LiveDesign models. Each CSV file corresponds to a column input, and the rows are identified by a corporate ID. The row source yields a row dict with the corporate ID as the unique identifier. The csv file for each input must be passed in as a tuple of (ColumnInput, filename) pairs.
- Example input file tuples:
(CompositeInput(name=’smiles’, type=InputType.STRING), ‘file1.csv’) (CompositeInput(name=’charge’, type=InputType.INTEGER), ‘file2.csv’)
- SDF_FILE = 'SDF_FILE'¶
- __init__(input_file_tuples: list[tuple[ColumnInput, str]])¶
- generateRows()¶
Must be implemented in child classes as a generator that yields dicts representing rows, where each dict contains the row data as well as a unique identifier under the key
ROW_SOURCE_ID_KEY.
- getRowSchema() dict[str, type]¶
Returns a dictionary mapping input names to their types for the rows generated by this row source.