Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Spot
Spot
Commits
f067dd78
Commit
f067dd78
authored
Apr 20, 2015
by
Etienne Renault
Browse files
Add setup method for spot.
* wrap/python/spot.py: here. * wrap/python/tests/automata.ipynb: tests here.
parent
d55c15ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
wrap/python/spot.py
View file @
f067dd78
...
...
@@ -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.
...
...
wrap/python/tests/automata.ipynb
View file @
f067dd78
...
...
@@ -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 0x10
52702d
0> >"
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x10
f07d3c
0> >"
]
}
],
...
...
@@ -308,7 +303,7 @@
"</svg>"
],
"text": [
"<IPython.core.display.SVG at 0x10
4c5a
390>"
"<IPython.core.display.SVG at 0x10
ea65
390>"
]
}
],
...
...
@@ -454,7 +449,7 @@
"</svg>"
],
"text": [
"<IPython.core.display.SVG at 0x1
06c689b
0>"
"<IPython.core.display.SVG at 0x1
10a75a2
0>"
]
}
],
...
...
@@ -547,7 +542,7 @@
"</svg>\n"
],
"text": [
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x1
06ca0
060> >"
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x1
10aae
060> >"
]
}
],
...
...
@@ -617,7 +612,7 @@
"</svg>\n"
],
"text": [
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x1
06ca0
120> >"
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x1
10aae
120> >"
]
}
],
...
...
@@ -686,7 +681,7 @@
"</svg>\n"
],
"text": [
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x1
06ca0
030> >"
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x1
10aae
030> >"
]
}
],
...
...
@@ -802,7 +797,7 @@
"</svg>"
],
"text": [
"<IPython.core.display.SVG at 0x1
06ca70b8
>"
"<IPython.core.display.SVG at 0x1
10ab21d0
>"
]
}
],
...
...
@@ -992,7 +987,7 @@
"</svg>"
],
"text": [
"<IPython.core.display.SVG at 0x1
06cb6940
>"
"<IPython.core.display.SVG at 0x1
10ac49e8
>"
]
}
],
...
...
@@ -1085,7 +1080,7 @@
"</svg>\n"
],
"text": [
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x10
52d
cfc0> >"
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x10
f0e
cfc0> >"
]
}
],
...
...
@@ -1559,7 +1554,7 @@
"</svg>\n"
],
"text": [
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x10
52d
cba0> >"
"<spot_impl.tgba_digraph; proxy of <Swig Object of type 'std::shared_ptr< spot::tgba_digraph > *' at 0x10
f0e
cba0> >"
]
}
],
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment