schrodinger.application.transforms.template.starter module

Starter code with a basic transform and pipeline to demonstrate how to use Beam.

If this is your first time writing a PTransform, please consider reading through the Beam style guide:

Usage:

$SCHRODINGER/run seam_example.py starter

See the unit tests for this example to see how to test your PTransforms.

class schrodinger.application.transforms.template.starter.CarbonCount(label: Optional[str] = None)

Bases: apache_beam.transforms.ptransform.PTransform

A PTransform that counts the number of carbon atoms in each molecule in the input PCollection.

This could also be accomplished by just using a ParDo, i.e.

CarbonCount = beam.ParDo(_CarbonCountDoFn())

But per the style guide, we expose our PTransform as a composite transform.

Expose every major data-parallel task accomplished by your library as a composite PTransform. This allows the structure of the transform to evolve transparently to the code that uses it: e.g. something that started as a ParDo can become a more complex transform over time.

https://beam.apache.org/contribute/ptransform-style-guide/#exposing-a-ptransform-vs-something-else

expand(molecule_pcoll)