prophesy package¶
Subpackages¶
- prophesy.data package
- Submodules
- prophesy.data.constant module
- prophesy.data.constraint module
- prophesy.data.hyperrectangle module
- prophesy.data.interval module
- prophesy.data.model_type module
- prophesy.data.nice_approximation module
- prophesy.data.parameter module
- prophesy.data.point module
- prophesy.data.property module
- prophesy.data.range module
- prophesy.data.samples module
- Submodules
- prophesy.regions package
- prophesy.sampling package
- prophesy.modelcheckers package
- prophesy.smt package
- prophesy.exceptions package
- prophesy.input package
- prophesy.output package
Utility methods¶
prophesy.util module¶
-
class
Configuration
(config_file)¶ Bases:
object
Configuration for prophesy.
-
check_existence
(section, key)¶ Check if the given key exists in the configuration and raise a ConfigurationError if not. :param section: Section. :param key: Key.
-
get
(section, key)¶ Get config value for given key. :param section: Section. :param key: Key. :return: Config value.
-
get_all
()¶ Get all entries of the configuration. :return: Dict with all entries.
-
get_boolean
(section, key)¶ Get config value as boolean. :param section: Section. :param key: Key. :return: Config value as boolean.
-
get_float
(section, key)¶ Get config value as float. :param section: Section. :param key: Key. :return: Config value as float.
-
get_int
(section, key)¶ Get config value as integer. :param section: Section. :param key: Key. :return: Config value as integer.
-
set
(section, key, value)¶ Set config entry. :param section: Section. :param key: Key. :param value: New value.
-
update_configuration_file
()¶ Write configuration file again.
-
-
check_filepath_for_reading
(filepath, filedescription_string='file')¶ Check if the given path can be read. Raises an IOError otherwise. :param filepath: Path. :param filedescription_string: Type of path (file/dir).
-
ensure_dir_exists
(path)¶ Check whether the directory exists and create it if not. Raises an IOError if not successful. :param path: Directory path.
-
open_file
(path)¶ Open file with system-default application. Works for Mac OS (open) and Linux with xdg-open. :param path: Path.
-
run_tool
(args, quiet=False, outputfile=None)¶ Executes a process. :param args: CLI arguments to execute. :param quiet: If false the output is logged. :param outputfile: Path for saving output. :return: Stdout of process or exitcode.
-
which
(program)¶ Check if executable exists and return its path. See http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python/377028#377028 :param program: String with name of the program. :return: Path to program or None if not found.
-
write_string_to_file
(path, string, append=False)¶ Write string to file. :param path: File where we want to put the string. :param string: New content. :param append: If True, append to file, else overwrite.
-
write_string_to_tmpfile
(string)¶ Write string to temporary file. :param string: New content. :return: The path to the temporary file.
prophesy.config module¶
-
class
ModulesConfig
¶ Bases:
prophesy.util.Configuration
-
DEPENDENCIES
= 'installed_deps'¶
-
has_pycarl_parser
()¶
-
has_stormpy
()¶
-
is_module_available
(module)¶
-
-
class
ProphesyConfig
(path_to_cfg)¶ Bases:
prophesy.util.Configuration
-
CONSTRAINTS
= 'constraints'¶
-
DIRECTORIES
= 'directories'¶
-
EXTERNAL_TOOLS
= 'external_tools'¶
-
SAMPLING
= 'sampling'¶
-
SMT
= 'smt'¶
-
check_tools
()¶
-
getAvailableParametricMCs
()¶ - Returns
A set with strings describing the available parametric pmcs.
-
getAvailableProbMCs
()¶
-
getAvailableSMTSolvers
()¶
-
getAvailableSamplers
()¶
-
getSection
(sec)¶
-
get_intermediate_dir
()¶
-
get_isat
()¶
-
get_param
()¶
-
get_plots_dir
()¶
-
get_prism
()¶
-
get_sampling_epsilon
()¶
-
get_sampling_min_distance
()¶
-
get_smt_memout
()¶
-
get_smt_timeout
()¶
-
get_storm
()¶
-
get_storm_pars
()¶
-
get_tool
(toolname)¶
-
get_yices
()¶
-
get_z3
()¶
-
has_gurobipy
()¶
-
has_stormpy
()¶
-
-
load_configuration
(path=None)¶