Commit f067dd78 authored by Etienne Renault's avatar Etienne Renault

Add setup method for spot.

* wrap/python/spot.py: here.
* wrap/python/tests/automata.ipynb: tests here.
parent d55c15ba
......@@ -25,6 +25,15 @@ from functools import lru_cache
# Global BDD dict so that we do not have to create one in user code.
_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
# interactive widget, we avoid some repeated calls to dot for
# identical inputs.
......
......@@ -18,7 +18,7 @@
"version": "3.4.2"
},
"name": "",
"signature": "sha256:7bcd29a20e60c508a998923ed5875f91f69cd4f3e77dca19795b976dab016b90"
"signature": "sha256:a45a88a09bb68e3c3ea4856e0dc7ab83ccc4afa607806beb1fa902de88e28792"
},
"nbformat": 3,
"nbformat_minor": 0,
......@@ -30,13 +30,8 @@
"collapsed": false,
"input": [
"import os\n",
"# Note that Spot (loaded by the kernel) will store a copy of\n",
"# the environment variable the first time it reads them, so\n",
"# 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"
"import spot\n",
"spot.setup(True)"
],
"language": "python",
"metadata": {},
......@@ -176,7 +171,7 @@
"</svg>\n"
],
"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>"
],
"text": [
"<IPython.core.display.SVG at 0x104c5a390>"
"<IPython.core.display.SVG at 0x10ea65390>"
]
}
],
......@@ -454,7 +449,7 @@
"</svg>"
],
"text": [
"<IPython.core.display.SVG at 0x106c689b0>"
"<IPython.core.display.SVG at 0x110a75a20>"
]
}
],
......@@ -547,7 +542,7 @@
"</svg>\n"
],
"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"
],
"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"
],
"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>"
],
"text": [
"<IPython.core.display.SVG at 0x106ca70b8>"
"<IPython.core.display.SVG at 0x110ab21d0>"
]
}
],
......@@ -992,7 +987,7 @@
"</svg>"
],
"text": [
"<IPython.core.display.SVG at 0x106cb6940>"
"<IPython.core.display.SVG at 0x110ac49e8>"
]
}
],
......@@ -1085,7 +1080,7 @@
"</svg>\n"
],
"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"
],
"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> >"
]
}
],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment