schrodinger.application.models.execution.transforms module¶
- class schrodinger.application.models.execution.transforms.GenerateRowsDoFn(row_source)¶
Bases:
DoFn- __init__(row_source)¶
- process(_)¶
Method to use for processing elements.
This is invoked by
DoFnRunnerfor each element of a inputPCollection.The following parameters can be used as default values on
processarguments to indicate that a DoFn accepts the corresponding parameters. For example, a DoFn might accept the element and its timestamp with the following signature:def process(element=DoFn.ElementParam, timestamp=DoFn.TimestampParam): ...
The full set of parameters is:
DoFn.ElementParam: element to be processed, should not be mutated.DoFn.SideInputParam: a side input that may be used when processing.DoFn.TimestampParam: timestamp of the input element.DoFn.WindowParam:Windowthe input element belongs to.DoFn.TimerParam: auserstate.RuntimeTimerobject defined by the spec of the parameter.DoFn.StateParam: auserstate.RuntimeStateobject defined by the spec of the parameter.DoFn.KeyParam: key associated with the element.DoFn.RestrictionParam: aniobase.RestrictionTrackerwill be provided here to allow treatment as a SplittableDoFn. The restriction tracker will be derived from the restriction provider in the parameter.DoFn.WatermarkEstimatorParam: a function that can be used to track output watermark of SplittableDoFnimplementations.DoFn.BundleContextParam: allows a shared context manager to be used per bundleDoFn.SetupContextParam: allows a shared context manager to be used per DoFn
- class schrodinger.application.models.execution.transforms.ReadFromRowSource(label: Optional[str] = None)¶
Bases:
_LocalOnlyPTransform,ReadFromRowSource
- class schrodinger.application.models.execution.transforms.WriteRowDoFn(row_sink)¶
Bases:
DoFn- __init__(row_sink)¶
- process(row: Row)¶
Method to use for processing elements.
This is invoked by
DoFnRunnerfor each element of a inputPCollection.The following parameters can be used as default values on
processarguments to indicate that a DoFn accepts the corresponding parameters. For example, a DoFn might accept the element and its timestamp with the following signature:def process(element=DoFn.ElementParam, timestamp=DoFn.TimestampParam): ...
The full set of parameters is:
DoFn.ElementParam: element to be processed, should not be mutated.DoFn.SideInputParam: a side input that may be used when processing.DoFn.TimestampParam: timestamp of the input element.DoFn.WindowParam:Windowthe input element belongs to.DoFn.TimerParam: auserstate.RuntimeTimerobject defined by the spec of the parameter.DoFn.StateParam: auserstate.RuntimeStateobject defined by the spec of the parameter.DoFn.KeyParam: key associated with the element.DoFn.RestrictionParam: aniobase.RestrictionTrackerwill be provided here to allow treatment as a SplittableDoFn. The restriction tracker will be derived from the restriction provider in the parameter.DoFn.WatermarkEstimatorParam: a function that can be used to track output watermark of SplittableDoFnimplementations.DoFn.BundleContextParam: allows a shared context manager to be used per bundleDoFn.SetupContextParam: allows a shared context manager to be used per DoFn
- class schrodinger.application.models.execution.transforms.WriteToRowSink(label: Optional[str] = None)¶
Bases:
_LocalOnlyPTransform,WriteToRowSink
- class schrodinger.application.models.execution.transforms.ExtractStructure(field: str = 'structure')¶
Bases:
PTransformExtract a Structure-valued field from a Row.
- __init__(field: str = 'structure')¶
- expand(pcoll)¶
- class schrodinger.application.models.execution.transforms.StructureToRow(properties: list[str | dict[str, str]] | None = None, strict: bool = False)¶
Bases:
PTransformConvert Structures to Rows for an LD-model row sink.
- Parameters:
properties – List of property keys / built-in attribute names to extract from each structure. Each element is either a plain string (when the key is a valid field name) or a
{output_name: property_key}dict to alias properties with non-identifier keys.strict – If True, raise when a requested property is missing. If False, missing properties yield empty cells in the LD output.
- __init__(properties: list[str | dict[str, str]] | None = None, strict: bool = False)¶
- expand(pcoll)¶