schrodinger.seam.debug module

This module provides…
  1. debug flags for the adjusting the behavior of the runner

    are used to control the behavior of the runner in ways that are useful for development and testing, but not for production. If SCHRODINGER_SRC is not set, all flags will be ignored.

  2. transforms for inspecting the contents of a PCollection

To enable a debug flag, call set_debug_flag with the flag you want to enable, like this:

`python from schrodinger.seam.runners import debug debug.set_debug_flag(debug.DebugFlag.TRANSPARENT_STDOUT) `

Alternatively, you can set the SCHRODINGER_SEAM_DEBUG_FLAGS environment variable to a comma-separated list of flags you want to enable. For example:

`shell export SCHRODINGER_SEAM_DEBUG_FLAGS=TRANSPARENT_STDOUT,RUNNER_LOGLEVEL_DEBUG `

For more information on the available flags, see DebugFlag.

class schrodinger.seam.debug.DebugFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: enum.StrEnum

TRANSPARENT_STDOUT = 'TRANSPARENT_STDOUT'

When set, the runner will not capture stdout and stderr from local worker processes. Instead, they will be printed directly to console.

RUNNER_LOGLEVEL_INFO = 'RUNNER_LOGLEVEL_INFO'

When set, the runner will log at INFO level, logging more to the console.

RUNNER_LOGLEVEL_DEBUG = 'RUNNER_LOGLEVEL_DEBUG'

When set, the runner will log at DEBUG level, logging even more to the console.

NO_PARALLEL = 'NO_PARALLEL'

When set, the runner will not distribute work to multiple workers at any stage of the pipeline. Instead, any work that doesn’t get done by local workers will never get done. Useful for quickly testing a workflow that would otherwise take a long time to run.

schrodinger.seam.debug.set_debug_flag(*flag: schrodinger.seam.debug.DebugFlag)
schrodinger.seam.debug.get_enabled_flags() set[schrodinger.seam.debug.DebugFlag]
schrodinger.seam.debug.is_enabled(flag: schrodinger.seam.debug.DebugFlag) bool
class schrodinger.seam.debug.IPythonInspect(label: Optional[str] = None)

Bases: apache_beam.transforms.ptransform.PTransform

A transform that allows you to interactively inspect the contents of a PCollection by dropping into an IPython shell.

Example usage:

>>> from schrodinger.seam import debug
>>> from schrodinger.seam.runners import SeamRunner
>>> with beam.Pipeline(runner=SeamRunner()) as p:
...    (p
...     | beam.Create([1, 2, 3])
...     | debug.IPythonInspect())
expand(pcoll)