from pywhy_graphs.viz import draw
from pywhy_graphs import PAG
pag = PAG()
pag.add_edge("I", "S", pag.directed_edge_name)
pag.add_edge("G", "S", pag.directed_edge_name)
pag.add_edge("G", "L", pag.directed_edge_name)
pag.add_edge("S", "L", pag.directed_edge_name)
pag.add_edge("PSH", "L", pag.directed_edge_name)
pag.add_edge("S", "PSH", pag.circle_edge_name)
pag.add_edge("S", "G", pag.circle_edge_name)
dot_graph = draw(pag)
Checklist
mainbranch.pip freeze.Description
Unable to draw this particular PAG.
The bug seems to be coming from viz/draw.py.
When the interpreter gets to line 45, the variable arrowtail has not been initialised.
It seems that there is no branch from lines 34 to 39 for handling the case where 'o->' edge has been provided.
Python traceback:
Related issues or possible duplicates
Environment
OS: MacOS 14.5 (Sonoma)
Python version:
Output of
pip freeze:Steps to reproduce
Example source: