qref icon indicating copy to clipboard operation
qref copied to clipboard

Add example with visualization

Open mstechly opened this issue 1 year ago • 0 comments

We should have an example how to use rendering module somewhere in our docs. I'm thinking about a bit more polished version of the following:

import yaml
from qref import SchemaV1
from qref.experimental.rendering import to_graphviz

with open("alias_sampling_detailed_fixed_resources.yaml", "r") as f:
    data = yaml.safe_load(f)
program = SchemaV1.model_validate(data)
gv_object = to_graphviz(program)
gv_object.render("as.png")

CC: @dexter2206

mstechly avatar May 14 '24 20:05 mstechly