schrodinger.seam.viz.inspect module

class schrodinger.seam.viz.inspect.TransformStatus(value)

Bases: enum.Enum

An enumeration.

PENDING = 'Pending'
RUNNING = 'Running'
COMPLETED = 'Completed'
PARTIALLY_COMPLETED = 'Partially Completed'
class schrodinger.seam.viz.inspect.PipelineDisplayInfo(start_time: str, end_time: Union[str, NoneType], 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)

Bases: enum.Enum

An enumeration.

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 the root transform ids (aka phase 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 phase (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 phase.

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 phase, then resulting transform proto for that phase will return [‘B’, ‘C’, ‘D’].

schrodinger.seam.viz.inspect.get_user_label_to_phase_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 phases that they are in.

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

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

For example, if the transforms “A”, “B”, and “C” are in phases “phase_1”, and “phase_2” represented by the following mapping:

{
    "A": {"phase_1"},
    "B": {"phase_1"},
    "C": {"phase_2"}
}

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

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