Add setup method for spot.
* wrap/python/spot.py: here. * wrap/python/tests/automata.ipynb: tests here.
This commit is contained in:
parent
d55c15baf2
commit
f067dd7871
2 changed files with 22 additions and 18 deletions
|
|
@ -25,6 +25,15 @@ from functools import lru_cache
|
||||||
# Global BDD dict so that we do not have to create one in user code.
|
# Global BDD dict so that we do not have to create one in user code.
|
||||||
_bdd_dict = make_bdd_dict()
|
_bdd_dict = make_bdd_dict()
|
||||||
|
|
||||||
|
# Load all preliminaries for a fancy display
|
||||||
|
def setup(show_bullet=True):
|
||||||
|
import os
|
||||||
|
os.environ['SPOT_DOTEXTRA'] = 'size="10.2,5" node[style=filled,fillcolor="#ffffaa"] edge[arrowhead=vee, arrowsize=.7]'
|
||||||
|
if show_bullet:
|
||||||
|
os.environ['SPOT_DOTDEFAULT'] = 'rbcf(Lato)'
|
||||||
|
else:
|
||||||
|
os.environ['SPOT_DOTDEFAULT'] = 'rcf(Lato)'
|
||||||
|
|
||||||
# Add a small LRU cache so that when we display automata into a
|
# Add a small LRU cache so that when we display automata into a
|
||||||
# interactive widget, we avoid some repeated calls to dot for
|
# interactive widget, we avoid some repeated calls to dot for
|
||||||
# identical inputs.
|
# identical inputs.
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
"version": "3.4.2"
|
"version": "3.4.2"
|
||||||
},
|
},
|
||||||
"name": "",
|
"name": "",
|
||||||
"signature": "sha256:7bcd29a20e60c508a998923ed5875f91f69cd4f3e77dca19795b976dab016b90"
|
"signature": "sha256:a45a88a09bb68e3c3ea4856e0dc7ab83ccc4afa607806beb1fa902de88e28792"
|
||||||
},
|
},
|
||||||
"nbformat": 3,
|
"nbformat": 3,
|
||||||
"nbformat_minor": 0,
|
"nbformat_minor": 0,
|
||||||
|
|
@ -30,13 +30,8 @@
|
||||||
"collapsed": false,
|
"collapsed": false,
|
||||||
"input": [
|
"input": [
|
||||||
"import os\n",
|
"import os\n",
|
||||||
"# Note that Spot (loaded by the kernel) will store a copy of\n",
|
"import spot\n",
|
||||||
"# the environment variable the first time it reads them, so\n",
|
"spot.setup(True)"
|
||||||
"# if you change those variables, the new values will be ignored\n",
|
|
||||||
"# until you restart the kernel.\n",
|
|
||||||
"os.environ['SPOT_DOTEXTRA'] = 'size=\"10.2,5\" node[style=filled,fillcolor=\"#ffffaa\"] edge[arrowhead=vee, arrowsize=.7]'\n",
|
|
||||||
"os.environ['SPOT_DOTDEFAULT'] = 'rbcf(Lato)'\n",
|
|
||||||
"import spot"
|
|
||||||
],
|
],
|
||||||
"language": "python",
|
"language": "python",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
|
@ -176,7 +171,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text": [
|
"text": [
|
||||||
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x1052702d0> >"
|
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x10f07d3c0> >"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
@ -308,7 +303,7 @@
|
||||||
"</svg>"
|
"</svg>"
|
||||||
],
|
],
|
||||||
"text": [
|
"text": [
|
||||||
"<IPython.core.display.SVG at 0x104c5a390>"
|
"<IPython.core.display.SVG at 0x10ea65390>"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
@ -454,7 +449,7 @@
|
||||||
"</svg>"
|
"</svg>"
|
||||||
],
|
],
|
||||||
"text": [
|
"text": [
|
||||||
"<IPython.core.display.SVG at 0x106c689b0>"
|
"<IPython.core.display.SVG at 0x110a75a20>"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
@ -547,7 +542,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text": [
|
"text": [
|
||||||
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x106ca0060> >"
|
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x110aae060> >"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
@ -617,7 +612,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text": [
|
"text": [
|
||||||
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x106ca0120> >"
|
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x110aae120> >"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
@ -686,7 +681,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text": [
|
"text": [
|
||||||
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x106ca0030> >"
|
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x110aae030> >"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
@ -802,7 +797,7 @@
|
||||||
"</svg>"
|
"</svg>"
|
||||||
],
|
],
|
||||||
"text": [
|
"text": [
|
||||||
"<IPython.core.display.SVG at 0x106ca70b8>"
|
"<IPython.core.display.SVG at 0x110ab21d0>"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
@ -992,7 +987,7 @@
|
||||||
"</svg>"
|
"</svg>"
|
||||||
],
|
],
|
||||||
"text": [
|
"text": [
|
||||||
"<IPython.core.display.SVG at 0x106cb6940>"
|
"<IPython.core.display.SVG at 0x110ac49e8>"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
@ -1085,7 +1080,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text": [
|
"text": [
|
||||||
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x1052dcfc0> >"
|
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x10f0ecfc0> >"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
@ -1559,7 +1554,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text": [
|
"text": [
|
||||||
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x1052dcba0> >"
|
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x10f0ecba0> >"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue