schrodinger.seam.viz.cascade module¶
- class schrodinger.seam.viz.cascade.CascadeStepConfig(*, output_key: str, label: str)¶
Bases:
BaseModel- output_key: str¶
- label: str¶
- model_config: ClassVar[ConfigDict] = {'frozen': True}¶
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- class schrodinger.seam.viz.cascade.CascadeFlowChartGenerator(steps: list[CascadeStepConfig], output_counts: dict[str, int], text_size: int = 5, input_count: int | None = None, input_label: str = 'Inputs')¶
Bases:
FlowChartGeneratorGenerate a vertical funnel-style chart for a cascade.
Each cascade step is shown as a centered horizontal bar with width proportional to the compound count, connected by ribbon shapes to form a funnel.
- VERTICAL_FIGSIZE = (8, 10)¶
- BAR_HEIGHT = 0.03¶
- BAR_MAX_WIDTH = 0.8¶
- BAR_VERTICAL_SPACING = 0.12¶
- LABEL_X_OFFSET = 0.05¶
- INPUT_NODE_ID = '__input__'¶
- __init__(steps: list[CascadeStepConfig], output_counts: dict[str, int], text_size: int = 5, input_count: int | None = None, input_label: str = 'Inputs')¶
Generate a flow chart for a cascade.
- Parameters:
steps – the cascade steps to report on
output_counts – mapping of step output keys to output counts
text_size – size of the label text
input_count – optional count for a starting input node
input_label – label for the starting input node (default ‘Inputs’)
- generate(image_path: Path, figsize: tuple[int, int] = (8, 10))¶
Render the cascade as a vertical funnel chart.
- Parameters:
image_path – Path to save the generated image.
figsize – Size of the figure in inches (width, height).