Commit 1fd0aa14 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

multiple adjustments for Debian stable

* tests/python/ipnbdoctest.py: Adjust to Python <3.6.
* tests/python/_autparserr.ipynb: Adjust to older IPython version.
* tests/python/stutter-inv.ipynb: Avoid pandas because its output
varies from version to version.
parent 527c8025
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
from IPython.display import display
import spot import spot
spot.setup() spot.setup()
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
Test syntax errors Test syntax errors
------------------ ------------------
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
%%file _example.aut %%file _example.aut
HOA: v1 HOA: v1
States: 2 States: 2
Start: 1 Start: 1
AP: 2 "a" "b" AP: 2 "a" "b"
acc-name: Buchi acc-name: Buchi
Acceptance: 1 Inf(0) Acceptance: 1 Inf(0)
--BODY-- --BODY--
State: 0 {0} State: 0 {0}
[t] 1 [t] 1
State: 1 State: 1
[t] 1 [t] 1
--END-- --END--
HOA: v1 HOA: v1
States: 2 States: 2
Start: 1 Start: 1
AP: 2 "a" "b" AP: 2 "a" "b"
Acceptance: 1 Inf(0) Acceptance: 1 Inf(0)
--BODY-- --BODY--
State: 0 {0} State: 0 {0}
[a] 3 [a] 3
State: 1 State: 1
[1] 0 [1] 0
[0&!1] 1 [0&!1] 1
--END-- --END--
``` ```
%%%% Output: stream %%%% Output: stream
Overwriting _example.aut Writing _example.aut
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
for a in spot.automata('_example.aut'): for a in spot.automata('_example.aut'):
display(a) display(a)
``` ```
%%%% Output: display_data %%%% Output: display_data
![](data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN""http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><!-- Generated by graphviz version 2.38.0 (20140413.2041)--><!-- Title: G Pages: 1 --><svg width="133pt" height="101pt"viewBox="0.00 0.00 133.00 101.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 97)"><title>G</title><polygon fill="white" stroke="none" points="-4,4 -4,-97 129,-97 129,4 -4,4"/><!-- I --><!-- 1 --><g id="node2" class="node"><title>1</title><ellipse fill="#ffffaa" stroke="black" cx="107" cy="-42" rx="18" ry="18"/><text text-anchor="middle" x="107" y="-38.3" font-family="Lato" font-size="14.00">1</text></g><!-- I&#45;&gt;1 --><g id="edge1" class="edge"><title>I&#45;&gt;1</title><path fill="none" stroke="black" d="M23.0602,-62.9848C24.6706,-62.5773 58.2688,-54.0766 82.2014,-48.0213"/><polygon fill="black" stroke="black" points="89.2724,-46.2323 83.2589,-51.0031 85.8793,-47.0908 82.4862,-47.9493 82.4862,-47.9493 82.4862,-47.9493 85.8793,-47.0908 81.7135,-44.8956 89.2724,-46.2323 89.2724,-46.2323"/></g><!-- 1&#45;&gt;1 --><g id="edge3" class="edge"><title>1&#45;&gt;1</title><path fill="none" stroke="black" d="M99.9688,-58.6641C98.4062,-68.625 100.75,-78 107,-78 111.688,-78 114.178,-72.7266 114.471,-65.8876"/><polygon fill="black" stroke="black" points="114.031,-58.6641 117.601,-65.4598 114.244,-62.1576 114.456,-65.6511 114.456,-65.6511 114.456,-65.6511 114.244,-62.1576 111.312,-65.8425 114.031,-58.6641 114.031,-58.6641"/><text text-anchor="middle" x="107" y="-81.8" font-family="Lato" font-size="14.00">1</text></g><!-- 0 --><g id="node3" class="node"><title>0</title><ellipse fill="#ffffaa" stroke="black" cx="22" cy="-22" rx="18" ry="18"/><ellipse fill="none" stroke="black" cx="22" cy="-22" rx="22" ry="22"/><text text-anchor="middle" x="22" y="-18.3" font-family="Lato" font-size="14.00">0</text></g><!-- 0&#45;&gt;1 --><g id="edge2" class="edge"><title>0&#45;&gt;1</title><path fill="none" stroke="black" d="M43.5169,-26.9438C55.3149,-29.7867 70.1833,-33.3695 82.4561,-36.3268"/><polygon fill="black" stroke="black" points="89.3394,-37.9854 81.7962,-39.4079 85.9368,-37.1655 82.5342,-36.3455 82.5342,-36.3455 82.5342,-36.3455 85.9368,-37.1655 83.2721,-33.2832 89.3394,-37.9854 89.3394,-37.9854"/><text text-anchor="middle" x="66.5" y="-37.8" font-family="Lato" font-size="14.00">1</text></g></g></svg>) ![](data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN""http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><!-- Generated by graphviz version 2.38.0 (20140413.2041)--><!-- Title: G Pages: 1 --><svg width="133pt" height="101pt"viewBox="0.00 0.00 133.00 101.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 97)"><title>G</title><polygon fill="white" stroke="none" points="-4,4 -4,-97 129,-97 129,4 -4,4"/><!-- I --><!-- 1 --><g id="node2" class="node"><title>1</title><ellipse fill="#ffffaa" stroke="black" cx="107" cy="-42" rx="18" ry="18"/><text text-anchor="middle" x="107" y="-38.3" font-family="Lato" font-size="14.00">1</text></g><!-- I&#45;&gt;1 --><g id="edge1" class="edge"><title>I&#45;&gt;1</title><path fill="none" stroke="black" d="M23.0602,-62.9848C24.6706,-62.5773 58.2688,-54.0766 82.2014,-48.0213"/><polygon fill="black" stroke="black" points="89.2724,-46.2323 83.2589,-51.0031 85.8793,-47.0908 82.4862,-47.9493 82.4862,-47.9493 82.4862,-47.9493 85.8793,-47.0908 81.7135,-44.8956 89.2724,-46.2323 89.2724,-46.2323"/></g><!-- 1&#45;&gt;1 --><g id="edge3" class="edge"><title>1&#45;&gt;1</title><path fill="none" stroke="black" d="M99.9688,-58.6641C98.4062,-68.625 100.75,-78 107,-78 111.688,-78 114.178,-72.7266 114.471,-65.8876"/><polygon fill="black" stroke="black" points="114.031,-58.6641 117.601,-65.4598 114.244,-62.1576 114.456,-65.6511 114.456,-65.6511 114.456,-65.6511 114.244,-62.1576 111.312,-65.8425 114.031,-58.6641 114.031,-58.6641"/><text text-anchor="middle" x="107" y="-81.8" font-family="Lato" font-size="14.00">1</text></g><!-- 0 --><g id="node3" class="node"><title>0</title><ellipse fill="#ffffaa" stroke="black" cx="22" cy="-22" rx="18" ry="18"/><ellipse fill="none" stroke="black" cx="22" cy="-22" rx="22" ry="22"/><text text-anchor="middle" x="22" y="-18.3" font-family="Lato" font-size="14.00">0</text></g><!-- 0&#45;&gt;1 --><g id="edge2" class="edge"><title>0&#45;&gt;1</title><path fill="none" stroke="black" d="M43.5169,-26.9438C55.3149,-29.7867 70.1833,-33.3695 82.4561,-36.3268"/><polygon fill="black" stroke="black" points="89.3394,-37.9854 81.7962,-39.4079 85.9368,-37.1655 82.5342,-36.3455 82.5342,-36.3455 82.5342,-36.3455 85.9368,-37.1655 83.2721,-33.2832 89.3394,-37.9854 89.3394,-37.9854"/><text text-anchor="middle" x="66.5" y="-37.8" font-family="Lato" font-size="14.00">1</text></g></g></svg>)
%%%% Output: error %%%% Output: error
File "<string>", line unknown File "<string>", line unknown
SyntaxError: SyntaxError:
_example.aut:20.2: syntax error, unexpected identifier _example.aut:20.2: syntax error, unexpected identifier
_example.aut:20.1-3: ignoring this invalid label _example.aut:20.1-3: ignoring this invalid label
_example.aut:20.5: state number is larger than state count... _example.aut:20.5: state number is larger than state count...
_example.aut:14.1-9: ... declared here. _example.aut:14.1-9: ... declared here.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
spot.automaton('_example.aut', timeout=100) spot.automaton('_example.aut', timeout=100)
``` ```
%%%% Output: execute_result %%%% Output: execute_result
![](data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN""http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><!-- Generated by graphviz version 2.38.0 (20140413.2041)--><!-- Title: G Pages: 1 --><svg width="133pt" height="101pt"viewBox="0.00 0.00 133.00 101.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 97)"><title>G</title><polygon fill="white" stroke="none" points="-4,4 -4,-97 129,-97 129,4 -4,4"/><!-- I --><!-- 1 --><g id="node2" class="node"><title>1</title><ellipse fill="#ffffaa" stroke="black" cx="107" cy="-42" rx="18" ry="18"/><text text-anchor="middle" x="107" y="-38.3" font-family="Lato" font-size="14.00">1</text></g><!-- I&#45;&gt;1 --><g id="edge1" class="edge"><title>I&#45;&gt;1</title><path fill="none" stroke="black" d="M23.0602,-62.9848C24.6706,-62.5773 58.2688,-54.0766 82.2014,-48.0213"/><polygon fill="black" stroke="black" points="89.2724,-46.2323 83.2589,-51.0031 85.8793,-47.0908 82.4862,-47.9493 82.4862,-47.9493 82.4862,-47.9493 85.8793,-47.0908 81.7135,-44.8956 89.2724,-46.2323 89.2724,-46.2323"/></g><!-- 1&#45;&gt;1 --><g id="edge3" class="edge"><title>1&#45;&gt;1</title><path fill="none" stroke="black" d="M99.9688,-58.6641C98.4062,-68.625 100.75,-78 107,-78 111.688,-78 114.178,-72.7266 114.471,-65.8876"/><polygon fill="black" stroke="black" points="114.031,-58.6641 117.601,-65.4598 114.244,-62.1576 114.456,-65.6511 114.456,-65.6511 114.456,-65.6511 114.244,-62.1576 111.312,-65.8425 114.031,-58.6641 114.031,-58.6641"/><text text-anchor="middle" x="107" y="-81.8" font-family="Lato" font-size="14.00">1</text></g><!-- 0 --><g id="node3" class="node"><title>0</title><ellipse fill="#ffffaa" stroke="black" cx="22" cy="-22" rx="18" ry="18"/><ellipse fill="none" stroke="black" cx="22" cy="-22" rx="22" ry="22"/><text text-anchor="middle" x="22" y="-18.3" font-family="Lato" font-size="14.00">0</text></g><!-- 0&#45;&gt;1 --><g id="edge2" class="edge"><title>0&#45;&gt;1</title><path fill="none" stroke="black" d="M43.5169,-26.9438C55.3149,-29.7867 70.1833,-33.3695 82.4561,-36.3268"/><polygon fill="black" stroke="black" points="89.3394,-37.9854 81.7962,-39.4079 85.9368,-37.1655 82.5342,-36.3455 82.5342,-36.3455 82.5342,-36.3455 85.9368,-37.1655 83.2721,-33.2832 89.3394,-37.9854 89.3394,-37.9854"/><text text-anchor="middle" x="66.5" y="-37.8" font-family="Lato" font-size="14.00">1</text></g></g></svg>) ![](data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN""http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><!-- Generated by graphviz version 2.38.0 (20140413.2041)--><!-- Title: G Pages: 1 --><svg width="133pt" height="101pt"viewBox="0.00 0.00 133.00 101.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 97)"><title>G</title><polygon fill="white" stroke="none" points="-4,4 -4,-97 129,-97 129,4 -4,4"/><!-- I --><!-- 1 --><g id="node2" class="node"><title>1</title><ellipse fill="#ffffaa" stroke="black" cx="107" cy="-42" rx="18" ry="18"/><text text-anchor="middle" x="107" y="-38.3" font-family="Lato" font-size="14.00">1</text></g><!-- I&#45;&gt;1 --><g id="edge1" class="edge"><title>I&#45;&gt;1</title><path fill="none" stroke="black" d="M23.0602,-62.9848C24.6706,-62.5773 58.2688,-54.0766 82.2014,-48.0213"/><polygon fill="black" stroke="black" points="89.2724,-46.2323 83.2589,-51.0031 85.8793,-47.0908 82.4862,-47.9493 82.4862,-47.9493 82.4862,-47.9493 85.8793,-47.0908 81.7135,-44.8956 89.2724,-46.2323 89.2724,-46.2323"/></g><!-- 1&#45;&gt;1 --><g id="edge3" class="edge"><title>1&#45;&gt;1</title><path fill="none" stroke="black" d="M99.9688,-58.6641C98.4062,-68.625 100.75,-78 107,-78 111.688,-78 114.178,-72.7266 114.471,-65.8876"/><polygon fill="black" stroke="black" points="114.031,-58.6641 117.601,-65.4598 114.244,-62.1576 114.456,-65.6511 114.456,-65.6511 114.456,-65.6511 114.244,-62.1576 111.312,-65.8425 114.031,-58.6641 114.031,-58.6641"/><text text-anchor="middle" x="107" y="-81.8" font-family="Lato" font-size="14.00">1</text></g><!-- 0 --><g id="node3" class="node"><title>0</title><ellipse fill="#ffffaa" stroke="black" cx="22" cy="-22" rx="18" ry="18"/><ellipse fill="none" stroke="black" cx="22" cy="-22" rx="22" ry="22"/><text text-anchor="middle" x="22" y="-18.3" font-family="Lato" font-size="14.00">0</text></g><!-- 0&#45;&gt;1 --><g id="edge2" class="edge"><title>0&#45;&gt;1</title><path fill="none" stroke="black" d="M43.5169,-26.9438C55.3149,-29.7867 70.1833,-33.3695 82.4561,-36.3268"/><polygon fill="black" stroke="black" points="89.3394,-37.9854 81.7962,-39.4079 85.9368,-37.1655 82.5342,-36.3455 82.5342,-36.3455 82.5342,-36.3455 85.9368,-37.1655 83.2721,-33.2832 89.3394,-37.9854 89.3394,-37.9854"/><text text-anchor="middle" x="66.5" y="-37.8" font-family="Lato" font-size="14.00">1</text></g></g></svg>)
<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fbec846c5a0> > <spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f72fc2ce090> >
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# Error reading from pipe # Error reading from pipe
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
spot.automaton('non-existing-cmd |') spot.automaton('non-existing-cmd |')
``` ```
%%%% Output: error %%%% Output: error
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
CalledProcessError Traceback (most recent call last) CalledProcessError Traceback (most recent call last)
<ipython-input-5-6b4750207d55> in <module>() <ipython-input-5-6b4750207d55> in <module>()
----> 1 spot.automaton('non-existing-cmd |') ----> 1 spot.automaton('non-existing-cmd |')
/home/adl/git/spot/python/spot/__init__.py in automaton(filename, **kwargs) /home/adl/git/spot/python/spot/__init__.py in automaton(filename, **kwargs)
479 See `spot.automata` for a list of supported formats.""" 479 See `spot.automata` for a list of supported formats."""
480 try: 480 try:
--> 481 return next(automata(filename, **kwargs)) --> 481 return next(automata(filename, **kwargs))
482 except StopIteration: 482 except StopIteration:
483 raise RuntimeError("Failed to read automaton from {}".format(filename)) 483 raise RuntimeError("Failed to read automaton from {}".format(filename))
/home/adl/git/spot/python/spot/__init__.py in automata(timeout, ignore_abort, trust_hoa, no_sid, debug, *sources) /home/adl/git/spot/python/spot/__init__.py in automata(timeout, ignore_abort, trust_hoa, no_sid, debug, *sources)
464 del proc 464 del proc
465 if ret: 465 if ret:
--> 466 raise subprocess.CalledProcessError(ret, filename[:-1]) --> 466 raise subprocess.CalledProcessError(ret, filename[:-1])
467 # deleting o explicitely now prevents Python 3.5 from 467 # deleting o explicitely now prevents Python 3.5 from
468 # reporting the following error: "<built-in function 468 # reporting the following error: "<built-in function
CalledProcessError: Command 'non-existing-cmd ' returned non-zero exit status 127. CalledProcessError: Command 'non-existing-cmd ' returned non-zero exit status 127.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
spot.automaton('sleep 3; cat _example.aut |', timeout=1) spot.automaton('sleep 3; cat _example.aut |', timeout=1)
``` ```
%%%% Output: error %%%% Output: error
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
TimeoutExpired Traceback (most recent call last) TimeoutExpired Traceback (most recent call last)
<ipython-input-6-e4289051db4c> in <module>() <ipython-input-6-e4289051db4c> in <module>()
----> 1 spot.automaton('sleep 3; cat _example.aut |', timeout=1) ----> 1 spot.automaton('sleep 3; cat _example.aut |', timeout=1)
/home/adl/git/spot/python/spot/__init__.py in automaton(filename, **kwargs) /home/adl/git/spot/python/spot/__init__.py in automaton(filename, **kwargs)
479 See `spot.automata` for a list of supported formats.""" 479 See `spot.automata` for a list of supported formats."""
480 try: 480 try:
--> 481 return next(automata(filename, **kwargs)) --> 481 return next(automata(filename, **kwargs))
482 except StopIteration: 482 except StopIteration:
483 raise RuntimeError("Failed to read automaton from {}".format(filename)) 483 raise RuntimeError("Failed to read automaton from {}".format(filename))
/home/adl/git/spot/python/spot/__init__.py in automata(timeout, ignore_abort, trust_hoa, no_sid, debug, *sources) /home/adl/git/spot/python/spot/__init__.py in automata(timeout, ignore_abort, trust_hoa, no_sid, debug, *sources)
423 else: 423 else:
424 try: 424 try:
--> 425 out, err = proc.communicate(timeout=timeout) --> 425 out, err = proc.communicate(timeout=timeout)
426 except subprocess.TimeoutExpired: 426 except subprocess.TimeoutExpired:
427 # Using subprocess.check_output() with timeout 427 # Using subprocess.check_output() with timeout
/usr/lib/python3.6/subprocess.py in communicate(self, input, timeout) /usr/lib/python3.6/subprocess.py in communicate(self, input, timeout)
841 841
842 try: 842 try:
--> 843 stdout, stderr = self._communicate(input, endtime, timeout) --> 843 stdout, stderr = self._communicate(input, endtime, timeout)
844 finally: 844 finally:
845 self._communication_started = True 845 self._communication_started = True
/usr/lib/python3.6/subprocess.py in _communicate(self, input, endtime, orig_timeout) /usr/lib/python3.6/subprocess.py in _communicate(self, input, endtime, orig_timeout)
1513 1513
1514 ready = selector.select(timeout) 1514 ready = selector.select(timeout)
-> 1515 self._check_timeout(endtime, orig_timeout) -> 1515 self._check_timeout(endtime, orig_timeout)
1516 1516
1517 # XXX Rewrite these to use non-blocking I/O on the file 1517 # XXX Rewrite these to use non-blocking I/O on the file
/usr/lib/python3.6/subprocess.py in _check_timeout(self, endtime, orig_timeout) /usr/lib/python3.6/subprocess.py in _check_timeout(self, endtime, orig_timeout)
869 return 869 return
870 if _time() > endtime: 870 if _time() > endtime:
--> 871 raise TimeoutExpired(self.args, orig_timeout) --> 871 raise TimeoutExpired(self.args, orig_timeout)
872 872
873 873
TimeoutExpired: Command 'sleep 3; cat _example.aut ' timed out after 1 seconds TimeoutExpired: Command 'sleep 3; cat _example.aut ' timed out after 1 seconds
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
for a in spot.automata("ltl2tgba 'a U b'|", 'ltl2tgba "syntax U U error"|'): for a in spot.automata("ltl2tgba 'a U b'|", 'ltl2tgba "syntax U U error"|'):
display(a) display(a)
``` ```
%%%% Output: display_data %%%% Output: display_data
![](data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN""http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><!-- Generated by graphviz version 2.38.0 (20140413.2041)--><!-- Title: G Pages: 1 --><svg width="171pt" height="85pt"viewBox="0.00 0.00 171.00 85.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 81)"><title>G</title><polygon fill="white" stroke="none" points="-4,4 -4,-81 167,-81 167,4 -4,4"/><!-- I --><!-- 1 --><g id="node2" class="node"><title>1</title><ellipse fill="#ffffaa" stroke="black" cx="56" cy="-22" rx="18" ry="18"/><text text-anchor="middle" x="56" y="-18.3" font-family="Lato" font-size="14.00">1</text></g><!-- I&#45;&gt;1 --><g id="edge1" class="edge"><title>I&#45;&gt;1</title><path fill="none" stroke="black" d="M1.15491,-22C2.79388,-22 17.1543,-22 30.6317,-22"/><polygon fill="black" stroke="black" points="37.9419,-22 30.9419,-25.1501 34.4419,-22 30.9419,-22.0001 30.9419,-22.0001 30.9419,-22.0001 34.4419,-22 30.9418,-18.8501 37.9419,-22 37.9419,-22"/></g><!-- 1&#45;&gt;1 --><g id="edge4" class="edge"><title>1&#45;&gt;1</title><path fill="none" stroke="black" d="M49.6208,-39.0373C48.3189,-48.8579 50.4453,-58 56,-58 60.166,-58 62.4036,-52.8576 62.7128,-46.1433"/><polygon fill="black" stroke="black" points="62.3792,-39.0373 65.8541,-45.8818 62.5434,-42.5335 62.7076,-46.0296 62.7076,-46.0296 62.7076,-46.0296 62.5434,-42.5335 59.561,-46.1774 62.3792,-39.0373 62.3792,-39.0373"/><text text-anchor="start" x="37.5" y="-61.8" font-family="Lato" font-size="14.00">a &amp; !b</text></g><!-- 0 --><g id="node3" class="node"><title>0</title><ellipse fill="#ffffaa" stroke="black" cx="141" cy="-22" rx="18" ry="18"/><ellipse fill="none" stroke="black" cx="141" cy="-22" rx="22" ry="22"/><text text-anchor="middle" x="141" y="-18.3" font-family="Lato" font-size="14.00">0</text></g><!-- 1&#45;&gt;0 --><g id="edge3" class="edge"><title>1&#45;&gt;0</title><path fill="none" stroke="black" d="M74.1977,-22C85.0734,-22 99.3874,-22 111.887,-22"/><polygon fill="black" stroke="black" points="118.997,-22 111.997,-25.1501 115.497,-22 111.997,-22.0001 111.997,-22.0001 111.997,-22.0001 115.497,-22 111.997,-18.8501 118.997,-22 118.997,-22"/><text text-anchor="start" x="92" y="-25.8" font-family="Lato" font-size="14.00">b</text></g><!-- 0&#45;&gt;0 --><g id="edge2" class="edge"><title>0&#45;&gt;0</title><path fill="none" stroke="black" d="M132.994,-42.5808C131.886,-52.8447 134.555,-62 141,-62 145.834,-62 148.544,-56.8502 149.129,-49.9451"/><polygon fill="black" stroke="black" points="149.006,-42.5808 152.273,-49.5273 149.065,-46.0803 149.123,-49.5798 149.123,-49.5798 149.123,-49.5798 149.065,-46.0803 145.973,-49.6324 149.006,-42.5808 149.006,-42.5808"/><text text-anchor="middle" x="141" y="-65.8" font-family="Lato" font-size="14.00">1</text></g></g></svg>) ![](data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN""http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><!-- Generated by graphviz version 2.38.0 (20140413.2041)--><!-- Title: G Pages: 1 --><svg width="171pt" height="85pt"viewBox="0.00 0.00 171.00 85.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 81)"><title>G</title><polygon fill="white" stroke="none" points="-4,4 -4,-81 167,-81 167,4 -4,4"/><!-- I --><!-- 1 --><g id="node2" class="node"><title>1</title><ellipse fill="#ffffaa" stroke="black" cx="56" cy="-22" rx="18" ry="18"/><text text-anchor="middle" x="56" y="-18.3" font-family="Lato" font-size="14.00">1</text></g><!-- I&#45;&gt;1 --><g id="edge1" class="edge"><title>I&#45;&gt;1</title><path fill="none" stroke="black" d="M1.15491,-22C2.79388,-22 17.1543,-22 30.6317,-22"/><polygon fill="black" stroke="black" points="37.9419,-22 30.9419,-25.1501 34.4419,-22 30.9419,-22.0001 30.9419,-22.0001 30.9419,-22.0001 34.4419,-22 30.9418,-18.8501 37.9419,-22 37.9419,-22"/></g><!-- 1&#45;&gt;1 --><g id="edge4" class="edge"><title>1&#45;&gt;1</title><path fill="none" stroke="black" d="M49.6208,-39.0373C48.3189,-48.8579 50.4453,-58 56,-58 60.166,-58 62.4036,-52.8576 62.7128,-46.1433"/><polygon fill="black" stroke="black" points="62.3792,-39.0373 65.8541,-45.8818 62.5434,-42.5335 62.7076,-46.0296 62.7076,-46.0296 62.7076,-46.0296 62.5434,-42.5335 59.561,-46.1774 62.3792,-39.0373 62.3792,-39.0373"/><text text-anchor="start" x="37.5" y="-61.8" font-family="Lato" font-size="14.00">a &amp; !b</text></g><!-- 0 --><g id="node3" class="node"><title>0</title><ellipse fill="#ffffaa" stroke="black" cx="141" cy="-22" rx="18" ry="18"/><ellipse fill="none" stroke="black" cx="141" cy="-22" rx="22" ry="22"/><text text-anchor="middle" x="141" y="-18.3" font-family="Lato" font-size="14.00">0</text></g><!-- 1&#45;&gt;0 --><g id="edge3" class="edge"><title>1&#45;&gt;0</title><path fill="none" stroke="black" d="M74.1977,-22C85.0734,-22 99.3874,-22 111.887,-22"/><polygon fill="black" stroke="black" points="118.997,-22 111.997,-25.1501 115.497,-22 111.997,-22.0001 111.997,-22.0001 111.997,-22.0001 115.497,-22 111.997,-18.8501 118.997,-22 118.997,-22"/><text text-anchor="start" x="92" y="-25.8" font-family="Lato" font-size="14.00">b</text></g><!-- 0&#45;&gt;0 --><g id="edge2" class="edge"><title>0&#45;&gt;0</title><path fill="none" stroke="black" d="M132.994,-42.5808C131.886,-52.8447 134.555,-62 141,-62 145.834,-62 148.544,-56.8502 149.129,-49.9451"/><polygon fill="black" stroke="black" points="149.006,-42.5808 152.273,-49.5273 149.065,-46.0803 149.123,-49.5798 149.123,-49.5798 149.123,-49.5798 149.065,-46.0803 145.973,-49.6324 149.006,-42.5808 149.006,-42.5808"/><text text-anchor="middle" x="141" y="-65.8" font-family="Lato" font-size="14.00">1</text></g></g></svg>)
%%%% Output: error %%%% Output: error
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
CalledProcessError Traceback (most recent call last) CalledProcessError Traceback (most recent call last)
<ipython-input-7-cf613d56390d> in <module>() <ipython-input-7-cf613d56390d> in <module>()
----> 1 for a in spot.automata("ltl2tgba 'a U b'|", 'ltl2tgba "syntax U U error"|'): ----> 1 for a in spot.automata("ltl2tgba 'a U b'|", 'ltl2tgba "syntax U U error"|'):
2 display(a) 2 display(a)
/home/adl/git/spot/python/spot/__init__.py in automata(timeout, ignore_abort, trust_hoa, no_sid, debug, *sources) /home/adl/git/spot/python/spot/__init__.py in automata(timeout, ignore_abort, trust_hoa, no_sid, debug, *sources)
464 del proc 464 del proc
465 if ret: 465 if ret:
--> 466 raise subprocess.CalledProcessError(ret, filename[:-1]) --> 466 raise subprocess.CalledProcessError(ret, filename[:-1])
467 # deleting o explicitely now prevents Python 3.5 from 467 # deleting o explicitely now prevents Python 3.5 from
468 # reporting the following error: "<built-in function 468 # reporting the following error: "<built-in function
CalledProcessError: Command 'ltl2tgba "syntax U U error"' returned non-zero exit status 2. CalledProcessError: Command 'ltl2tgba "syntax U U error"' returned non-zero exit status 2.
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
Reading an empty file with `spot.automaton()` is an error. Reading an empty file with `spot.automaton()` is an error.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
spot.automaton('true|') spot.automaton('true|')
``` ```
%%%% Output: error %%%% Output: error
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
StopIteration Traceback (most recent call last) StopIteration Traceback (most recent call last)
/home/adl/git/spot/python/spot/__init__.py in automaton(filename, **kwargs) /home/adl/git/spot/python/spot/__init__.py in automaton(filename, **kwargs)
480 try: 480 try:
--> 481 return next(automata(filename, **kwargs)) --> 481 return next(automata(filename, **kwargs))
482 except StopIteration: 482 except StopIteration:
StopIteration: StopIteration:
During handling of the above exception, another exception occurred: During handling of the above exception, another exception occurred:
RuntimeError Traceback (most recent call last) RuntimeError Traceback (most recent call last)
<ipython-input-8-139f3bb684aa> in <module>() <ipython-input-8-139f3bb684aa> in <module>()
----> 1 spot.automaton('true|') ----> 1 spot.automaton('true|')
/home/adl/git/spot/python/spot/__init__.py in automaton(filename, **kwargs) /home/adl/git/spot/python/spot/__init__.py in automaton(filename, **kwargs)
481 return next(automata(filename, **kwargs)) 481 return next(automata(filename, **kwargs))
482 except StopIteration: 482 except StopIteration:
--> 483 raise RuntimeError("Failed to read automaton from {}".format(filename)) --> 483 raise RuntimeError("Failed to read automaton from {}".format(filename))
484 484
485 485
RuntimeError: Failed to read automaton from true| RuntimeError: Failed to read automaton from true|
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
!rm _example.aut !rm _example.aut
``` ```
......
...@@ -115,12 +115,9 @@ def canonicalize(s, type, ignores): ...@@ -115,12 +115,9 @@ def canonicalize(s, type, ignores):
s = re.sub(r' fill="black"', '', s) s = re.sub(r' fill="black"', '', s)
s = re.sub(r' stroke="transparent"', ' stroke="none"', s) s = re.sub(r' stroke="transparent"', ' stroke="none"', s)
s = re.sub(r'><title>', '>\n<title>', s) s = re.sub(r'><title>', '>\n<title>', s)
# Different Pandas versions produce different CSS styles. # Different Pandas versions produce different CSS styles (when there is a
s = re.sub(r'<style[ a-z]*>.*</style>', # style).
'<style>...</style>', s, flags=re.DOTALL) s = re.sub(r'<style[ a-z]*>.*</style>\n', '', s, flags=re.DOTALL)
# CalledProcessError message has a final dot in Python 3.6
s = re.sub(r"(' returned non-zero exit status \d+)\.", r'\1', s)
for n, p in enumerate(ignores): for n, p in enumerate(ignores):
s = re.sub(p, 'IGN{}'.format(n), s) s = re.sub(p, 'IGN{}'.format(n), s)
...@@ -145,6 +142,12 @@ def canonical_dict(dict, ignores): ...@@ -145,6 +142,12 @@ def canonical_dict(dict, ignores):
# sys.exit(77) is used to Skip the test. # sys.exit(77) is used to Skip the test.
sys.exit(77) sys.exit(77)
if 'ename' in dict and dict['ename'] == 'CalledProcessError':
# CalledProcessError message has a final dot in Python 3.6
dict['evalue'] = \
re.sub(r"(' returned non-zero exit status \d+)\.", r'\1',
dict['evalue'])
if 'transient' in dict: if 'transient' in dict:
del dict['transient'] del dict['transient']
if 'execution_count' in dict: if 'execution_count' in dict:
......
This diff is collapsed.
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