diff --git a/src/python/storm-expression.cpp b/src/python/storm-expression.cpp deleted file mode 100644 index 98043bc4b..000000000 --- a/src/python/storm-expression.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include - -#include "helpers.h" -#include "boostPyExtension.h" - -#include "../storage/expressions/ExpressionManager.h" - - -BOOST_PYTHON_MODULE(_expressions) -{ - using namespace boost::python; - - defineClass("ExpressionManager", - "Manages variables for expressions"); - defineClass("Expression", - ""); - -} diff --git a/stormpy/lib/stormpy/expressions/__init__.py b/stormpy/lib/stormpy/expressions/__init__.py new file mode 100644 index 000000000..b185f368c --- /dev/null +++ b/stormpy/lib/stormpy/expressions/__init__.py @@ -0,0 +1,2 @@ +from . import expressions +from .expressions import * diff --git a/stormpy/setup.py b/stormpy/setup.py index 38a96829b..612385160 100755 --- a/stormpy/setup.py +++ b/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, diff --git a/stormpy/src/mod_expressions.cpp b/stormpy/src/mod_expressions.cpp new file mode 100644 index 000000000..ffe9a223c --- /dev/null +++ b/stormpy/src/mod_expressions.cpp @@ -0,0 +1,16 @@ +#include "common.h" +#include "helpers.h" + +#include + +PYBIND11_PLUGIN(expressions) { + py::module m("stormpy.expressions", "Storm expressions"); + + py::class_>(m, "ExpressionManager", "Manages variables for expressions") + ; + + py::class_(m, "Expression", "Holds an expression") + ; + + return m.ptr(); +}