Browse Source

Make config from info available

refactoring
Matthias Volk 7 years ago
parent
commit
f6f28b4621
  1. 26
      lib/stormpy/info/__init__.py
  2. 8
      tests/info/test_info.py
  3. 2
      tests/pars/test_parametric.py

26
lib/stormpy/info/__init__.py

@ -1,2 +1,28 @@
from . import info
from .info import *
from . import _config
def storm_version():
"""
Get storm version.
:return: Storm version
"""
return _config.storm_version
def storm_exact_use_cln():
"""
Check if exact arithmetic in Storm uses CLN.
:return: True if exact arithmetic uses CLN.
"""
return _config.storm_cln_ea
def storm_ratfunc_use_cln():
"""
Check if rational functions in Storm use CLN.
:return: True iff rational functions use CLN.
"""
return _config.storm_cln_rf

8
tests/info/test_info.py

@ -1,9 +1,9 @@
import stormpy
from stormpy.info import info
import stormpy.info
class TestInfo:
def test_version(self):
assert isinstance(info.Version.short, str) and "." in info.Version.short
assert isinstance(info.Version.long, str) and "Version" in info.Version.long
assert isinstance(info.Version.build_info, str) and "Compiled" in info.Version.build_info
assert isinstance(stormpy.info.Version.short, str) and "." in stormpy.info.Version.short
assert isinstance(stormpy.info.Version.long, str) and "Version" in stormpy.info.Version.long
assert isinstance(stormpy.info.Version.build_info, str) and "Compiled" in stormpy.info.Version.build_info

2
tests/pars/test_parametric.py

@ -7,7 +7,9 @@ class TestParametric:
def test_constraints_collector(self):
from pycarl.formula import FormulaType, Relation
if stormpy.info.storm_ratfunc_use_cln():
import pycarl.cln.formula
else:
import pycarl.gmp.formula
program = stormpy.parse_prism_program(get_example_path("pdtmc", "brp16_2.pm"))
prop = "P=? [F s=5]"

Loading…
Cancel
Save