schrodinger.stepper.viz module¶
Visualization tools for generating plots based on stepper runs and workflows.
EXAMPLE CMDLINE USAGE
To create a timeline plot from a statistics.json created from a workflow run:
$SCHRODINGER/run python3 -m schrodinger.stepper.viz statistics.json timeline.html –timeline
To create an outputs plot from a statistics.json created from a workflow run:
$SCHRODINGER/run python3 -m schrodinger.stepper.viz statistics.json outputs_plot.html –outputs_plot –outputs_plot_depth 1
- class schrodinger.stepper.viz.VizWebpage(fname)¶
Bases:
object
A class for creating a visualization webpage for different stepper workflow charts. Example usage:
workflow = MyStepperWorkflow() workflow.setInputs(range(10)) op = workflow.getOutputs() with VizWebpage('my_summary_charts.html') as page: page.addChart(TimelinePlot(workflow)) page.addChart(OutputsPlot(workflow, depth=1))
- __init__(fname)¶
- addChart(chart: schrodinger.stepper.viz.AbstractPlot)¶
- write()¶
- class schrodinger.stepper.viz.AbstractPlot¶
Bases:
object
A base class for implementing stepper charts. Subclasses must implement:
getJSScript
getHtml
- __init__()¶
- getJSScript() str ¶
Must be implemented by subclasses. Expects the requisite javascript to generate the plot. This will usually look something like:
"<script><!--do javascript stuff that generates plot---></script>"
This script is added to the header of the visualization webpage.
- getHtml() str ¶
Must be implemented by subclasses. Expects the requisite html to generate the plot. This is usually just a div with an id that the javascript references. e.g.
“<div id=’my_plot_1’></div>”
This div is added to the body of the visualization webpage.
- class schrodinger.stepper.viz.TopologyChart(workflow: schrodinger.stepper.stepper._BaseStep)¶
Bases:
schrodinger.stepper.viz.AbstractPlot
Plots the hierarchy of a workflow (i.e. a tree where parents are chains and children are substeps)
- __init__(workflow: schrodinger.stepper.stepper._BaseStep)¶
- getJSScript() str ¶
Must be implemented by subclasses. Expects the requisite javascript to generate the plot. This will usually look something like:
"<script><!--do javascript stuff that generates plot---></script>"
This script is added to the header of the visualization webpage.
- getHtml()¶
Must be implemented by subclasses. Expects the requisite html to generate the plot. This is usually just a div with an id that the javascript references. e.g.
“<div id=’my_plot_1’></div>”
This div is added to the body of the visualization webpage.
- class schrodinger.stepper.viz.TimelinePlot(workflow_or_stats_fname)¶
Bases:
schrodinger.stepper.viz._AbstractStatsPlot
See https://developers.google.com/chart/interactive/docs/gallery/timeline for an example timeline plot.
Stepper timeline charts visualize what steps are running and for how long. These charts are useful for profiling and determining where bottlenecks are in the workflow.
- getJSScript() str ¶
Must be implemented by subclasses. Expects the requisite javascript to generate the plot. This will usually look something like:
"<script><!--do javascript stuff that generates plot---></script>"
This script is added to the header of the visualization webpage.
- getHtml() str ¶
Must be implemented by subclasses. Expects the requisite html to generate the plot. This is usually just a div with an id that the javascript references. e.g.
“<div id=’my_plot_1’></div>”
This div is added to the body of the visualization webpage.
- __init__(workflow_or_stats_fname)¶
Take either a completed workflow or the filename of a written out
run_info
and timeline plot that shows what steps were running and for how long.- Parameters
workflow_or_stats_fname – A chain or step that has been run or a json file written from a step’s
run_info
(e.g.json.dump(my_chain.getRunInfo(), open('statistics.json', 'w'))
)- Raises
RuntimeError – If the given step has not yet been run.
- class schrodinger.stepper.viz.OutputsPlot(fname, depth)¶
Bases:
schrodinger.stepper.viz._AbstractStatsPlot
An area chart visualization of the outputs per step in the workflow.
See https://developers.google.com/chart/interactive/docs/gallery/areachart for an example of what these look like.
- __init__(fname, depth)¶
Take either a completed workflow or the filename of a written out
run_info
and timeline plot that shows what steps were running and for how long.- Parameters
workflow_or_stats_fname – A chain or step that has been run or a json file written from a step’s
run_info
(e.g.json.dump(my_chain.getRunInfo(), open('statistics.json', 'w'))
)- Raises
RuntimeError – If the given step has not yet been run.
- getJSScript()¶
Must be implemented by subclasses. Expects the requisite javascript to generate the plot. This will usually look something like:
"<script><!--do javascript stuff that generates plot---></script>"
This script is added to the header of the visualization webpage.
- getHtml()¶
Must be implemented by subclasses. Expects the requisite html to generate the plot. This is usually just a div with an id that the javascript references. e.g.
“<div id=’my_plot_1’></div>”
This div is added to the body of the visualization webpage.
- schrodinger.stepper.viz.main()¶