schrodinger.seam.viz.inspect module

class schrodinger.seam.viz.inspect.TransformStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: enum.Enum

PENDING = 'Pending'
RUNNING = 'Running'
COMPLETED = 'Completed'
PARTIALLY_COMPLETED = 'Partially Completed'
class schrodinger.seam.viz.inspect.PipelineDisplayInfo(start_time: str, end_time: Optional[str], duration: str, status: str)

Bases: object

start_time: str
end_time: Optional[str]
duration: str
status: str
__init__(start_time: str, end_time: Optional[str], duration: str, status: str) None
class schrodinger.seam.viz.inspect.PipelineStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: enum.Enum

RUNNING = 'Running'
COMPLETED = 'Completed'
schrodinger.seam.viz.inspect.get_pipeline_info(seam_events_path: pathlib.Path) schrodinger.seam.viz.inspect.PipelineDisplayInfo

Infer the start time, end time, duration, and status of a pipeline from a seam events file.

schrodinger.seam.viz.inspect.get_pipeline_start_time(seam_events_path: pathlib.Path) float

Infer the start time of a pipeline from a seam events file.

schrodinger.seam.viz.inspect.get_raw_user_labels(pipeline_proto: org.apache.beam.model.pipeline.v1.beam_runner_api_pb2.Pipeline) Dict[str, str]

Given a user pipeline proto (i.e. a pipeline proto that has not been optimized), returns a mapping from user labels to stage ids (aka stage ids) that they correspond to.

schrodinger.seam.viz.inspect.get_annotated_user_labels(transform_proto: org.apache.beam.model.pipeline.v1.beam_runner_api_pb2.PTransform) list

Given a transform proto of a stage (i.e. a transform proto that has been in an optimized pipeline), returns a list of all the user labels that have been annotated to that stage.

For example, in the following pipeline:

with beam.Pipeline() as p:
    _ = (p
        | 'A' >> beam.Create([1, 2, 3])
        | 'B' >> beam.Map(lambda x: x + 1)
        | 'C' >> beam.Map(lambda x: x + 1)
        | 'D' >> beam.Map(lambda x: x + 1)
    )

If ‘B’, ‘C’, and ‘D’ are all fused into the same stage, then resulting transform proto for that stage will return [‘B’, ‘C’, ‘D’].

schrodinger.seam.viz.inspect.get_user_label_to_stage_mapping(optimized_pipeline: org.apache.beam.model.pipeline.v1.beam_runner_api_pb2.Pipeline) Dict[str, set]

Given a preoptimized pipeline proto and an optimized pipeline proto, returns a mapping from user labels to the stages that they are in.

schrodinger.seam.viz.inspect.get_inferred_statuses(xform_to_stage_mapping: Dict[str, set], running: List[str], complete: List[str]) Dict[str, str]

Given a mapping from user labels to the stages that they are in, and a list of running stages and completed stages, returns a mapping from user labels to statuses.

For example, if the transforms “A”, “B”, and “C” are in stages “stage_1”, and “stage_2” represented by the following mapping:

{
    "A": {"stage_1"},
    "B": {"stage_1"},
    "C": {"stage_2"}
}

And “stage_1” is complete and “stage_2” is running, then the following mapping will be returned:

{
    "A": "Completed",
    "B": "Completed",
    "C": "Running"
}