schrodinger.seam.options.pipeline_options module

class schrodinger.seam.options.pipeline_options.SeamOptions(flags: Optional[List[str]] = None, experimental_fixed_scale_transforms: Optional[List[Type[PTransform]]] = None, **kwargs)

Bases: PipelineOptions

INFERRED = -1
__init__(flags: Optional[List[str]] = None, experimental_fixed_scale_transforms: Optional[List[Type[PTransform]]] = None, **kwargs)

Initialize an options class.

The initializer will traverse all subclasses, add all their argparse arguments and then parse the command line specified by flags or by default the one obtained from sys.argv.

The subclasses of PipelineOptions do not need to redefine __init__.

Args:
flags: An iterable of command line arguments to be used. If not specified

then sys.argv will be used as input for parsing arguments.

**kwargs: Add overrides for arguments passed in flags. For overrides

of arguments, please pass the option names instead of flag names. Option names: These are defined as dest in the parser.add_argument() for each flag. Passing flags like {no_use_public_ips: True}, for which the dest is defined to a different flag name in the parser, would be discarded. Instead, pass the dest of the flag (dest of no_use_public_ips is use_public_ips).

isDefault() bool
getNondefaultOptions() dict

Returns a dictionary of command line options that have been overridden from their default values.

getMaxWorkers() int

Get the maximum number of workers to use for the pipeline. If –max_workers is unset, this value is inferred by the context of the job. If not in the context of a job, the runner scales to 2/3rds of available CPUs. If in the context of a job, the number of workers is set to the number of subjobs specified in the HOST or SUBHOST argument. If no subjobs are specified, the number of workers is set to _DEFAULT_MAX_WORKERS.

getFixedScaleTransformPaths() List[str]

Get the list of transform paths that should be scaled.

Returns:

A list of transform paths in the format “module.ClassName”.

validate(validator: PipelineOptionsValidator) List[str]
getWorkerTimeoutInSeconds() int
class schrodinger.seam.options.pipeline_options.ExperimentalPersistentWorkerOptions(flags: Optional[Sequence[str]] = None, **kwargs)

Bases: PipelineOptions

getNumSubprocessWorkers() int

Get the number of subprocess workers to use for bundle execution.

Returns:

The configured value, or cpu_count - num_output_processors if not set (minimum 0).

getNumOutputProcessors() int

Get the max number of processes for output processing.

On Windows, spawning processes while gRPC threads are active causes access violations in CreateProcess, so we disable subprocess output processing entirely.

Returns:

The configured value, 0 on Windows, or 4 otherwise.

schrodinger.seam.options.pipeline_options.decode_none(options: dict) dict

Restore None values that were encoded with the sentinel when the options were serialized to the metadata file.

schrodinger.seam.options.pipeline_options.get_seam_only_options(options: SeamOptions) dict

Returns non-default options from SeamOptions and ExperimentalPersistentWorkerOptions, excluding Beam framework options.

None values are encoded with a sentinel so they survive serialization to the metadata file; use decode_none to restore them.