Skip to content
GitLab
Menu
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
ee30f966
Commit
ee30f966
authored
Mar 28, 2018
by
Alexandre Duret-Lutz
Browse files
python: fix error message of translate()/posprocess()
* python/spot/__init__.py: Here. * NEWS: Mention the bug.
parent
4ac3143b
Changes
2
Hide whitespace changes
Inline
Side-by-side
NEWS
View file @
ee30f966
...
...
@@ -32,6 +32,9 @@ New in spot 2.5.2.dev (not yet released)
- "autfilt --cobuchi --small/--det" would turn a transition-based
co-Büchi automaton into a state-based co-Büchi.
- Fix cryptic error message from Python's spot.translate() and
spot.postprocess() when supplying conflicting arguments.
New in spot 2.5.2 (2018-03-25)
Bugs fixed:
...
...
python/spot/__init__.py
View file @
ee30f966
...
...
@@ -484,8 +484,11 @@ def automaton(filename, **kwargs):
def
_postproc_translate_options
(
obj
,
default_type
,
*
args
):
type_name_
=
None
type_
=
None
pref_name_
=
None
pref_
=
None
optm_name_
=
None
optm_
=
None
comp_
=
0
unam_
=
0
...
...
@@ -493,10 +496,10 @@ def _postproc_translate_options(obj, default_type, *args):
colo_
=
0
def
type_set
(
val
):
nonlocal
type_
if
type_
is
not
None
and
type_
!=
val
:
nonlocal
type_
,
type_name_
if
type_
is
not
None
and
type_
name_
!=
val
:
raise
ValueError
(
"type cannot be both {} and {}"
.
format
(
type_
,
val
))
.
format
(
type_
name_
,
val
))
elif
val
==
'generic'
:
type_
=
postprocessor
.
Generic
elif
val
==
'tgba'
:
...
...
@@ -529,12 +532,13 @@ def _postproc_translate_options(obj, default_type, *args):
else
:
assert
(
val
==
'monitor'
)
type_
=
postprocessor
.
Monitor
type_name_
=
val
def
pref_set
(
val
):
nonlocal
pref_
if
pref_
is
not
None
and
pref_
!=
val
:
nonlocal
pref_
,
pref_name_
if
pref_
is
not
None
and
pref_
name_
!=
val
:
raise
ValueError
(
"preference cannot be both {} and {}"
.
format
(
pref_
,
val
))
.
format
(
pref_
name
,
val
))
elif
val
==
'small'
:
pref_
=
postprocessor
.
Small
elif
val
==
'deterministic'
:
...
...
@@ -542,12 +546,13 @@ def _postproc_translate_options(obj, default_type, *args):
else
:
assert
(
val
==
'any'
)
pref_
=
postprocessor
.
Any
pref_name_
=
val
def
optm_set
(
val
):
nonlocal
optm_
if
optm_
is
not
None
and
optm_
!=
val
:
nonlocal
optm_
,
optm_name_
if
optm_
is
not
None
and
optm_
name_
!=
val
:
raise
ValueError
(
"optimization level cannot be both {} and {}"
.
format
(
optm_
,
val
))
.
format
(
optm_
name_
,
val
))
if
val
==
'high'
:
optm_
=
postprocessor
.
High
elif
val
.
startswith
(
'med'
):
...
...
@@ -555,6 +560,7 @@ def _postproc_translate_options(obj, default_type, *args):
else
:
assert
(
val
==
'low'
)
optm_
=
postprocessor
.
Low
optm_name_
=
val
def
misc_set
(
val
):
nonlocal
comp_
,
unam_
,
sbac_
,
colo_
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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