Browse Source

Transfered expressions

Former-commit-id: 68e95c5f12
tempestpy_adaptions
Mavo 9 years ago
parent
commit
217aacb5dc
  1. 19
      src/python/storm-expression.cpp
  2. 2
      stormpy/lib/stormpy/expressions/__init__.py
  3. 19
      stormpy/setup.py
  4. 16
      stormpy/src/mod_expressions.cpp

19
src/python/storm-expression.cpp

@ -1,19 +0,0 @@
#include <boost/python.hpp>
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
#include "helpers.h"
#include "boostPyExtension.h"
#include "../storage/expressions/ExpressionManager.h"
BOOST_PYTHON_MODULE(_expressions)
{
using namespace boost::python;
defineClass<storm::expressions::ExpressionManager, void, boost::noncopyable>("ExpressionManager",
"Manages variables for expressions");
defineClass<storm::expressions::Expression, void, boost::noncopyable>("Expression",
"");
}

2
stormpy/lib/stormpy/expressions/__init__.py

@ -0,0 +1,2 @@
from . import expressions
from .expressions import *

19
stormpy/setup.py

@ -10,7 +10,7 @@ PROJECT_DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
# Glob source files for modules
core_sources = glob(os.path.join('src', 'core', '*.cpp'))
info_sources = glob(os.path.join('src', 'info', '*.cpp'))
expressions_sources = glob(os.path.join('src', 'expressions', '*.cpp'))
# Configuration shared between external modules follows
@ -47,7 +47,18 @@ ext_core = Extension(
ext_info = Extension(
name='info.info',
sources=['src/mod_info.cpp'] + info_sources,
sources=['src/mod_info.cpp'],
include_dirs=include_dirs,
libraries=libraries,
library_dirs=library_dirs,
extra_compile_args=extra_compile_args,
define_macros=define_macros,
extra_link_args=extra_link_args
)
ext_expressions = Extension(
name='expressions.expressions',
sources=['src/mod_expressions.cpp'] + expressions_sources,
include_dirs=include_dirs,
libraries=libraries,
library_dirs=library_dirs,
@ -99,10 +110,10 @@ setup(name="stormpy",
maintainer_email="sebastian.junges@cs.rwth-aachen.de",
url="http://moves.rwth-aachen.de",
description="stormpy - Python Bindings for Storm",
packages=['stormpy', 'stormpy.info'],
packages=['stormpy', 'stormpy.info', 'stormpy.expressions'],
package_dir={'':'lib'},
ext_package='stormpy',
ext_modules=[ext_core, ext_info
ext_modules=[ext_core, ext_info, ext_expressions
],
cmdclass={
'build_ext': stormpy_build_ext,

16
stormpy/src/mod_expressions.cpp

@ -0,0 +1,16 @@
#include "common.h"
#include "helpers.h"
#include <src/storage/expressions/ExpressionManager.h>
PYBIND11_PLUGIN(expressions) {
py::module m("stormpy.expressions", "Storm expressions");
py::class_<std::shared_ptr<storm::expressions::ExpressionManager>>(m, "ExpressionManager", "Manages variables for expressions")
;
py::class_<storm::expressions::Expression>(m, "Expression", "Holds an expression")
;
return m.ptr();
}
Loading…
Cancel
Save