Browse Source

Use PYBIND11_MODULE instead of PYBIND11_PLUGIN

refactoring
Matthias Volk 7 years ago
parent
commit
4c64f2a0fe
  1. 5
      src/mod_core.cpp
  2. 5
      src/mod_dft.cpp
  3. 6
      src/mod_expressions.cpp
  4. 6
      src/mod_info.cpp
  5. 5
      src/mod_logic.cpp
  6. 5
      src/mod_pars.cpp
  7. 5
      src/mod_storage.cpp
  8. 6
      src/mod_utility.cpp

5
src/mod_core.cpp

@ -6,8 +6,8 @@
#include "core/bisimulation.h"
#include "core/input.h"
PYBIND11_PLUGIN(core) {
py::module m("core");
PYBIND11_MODULE(core, m) {
m.doc() = "core";
#ifdef STORMPY_DISABLE_SIGNATURE_DOC
py::options options;
@ -24,5 +24,4 @@ PYBIND11_PLUGIN(core) {
define_modelchecking(m);
define_bisimulation(m);
define_input(m);
return m.ptr();
}

5
src/mod_dft.cpp

@ -2,8 +2,8 @@
#include "dft/dft.h"
PYBIND11_PLUGIN(dft) {
py::module m("dft", "Functionality for DFT analysis");
PYBIND11_MODULE(dft, m) {
m.doc() = "Functionality for DFT analysis";
#ifdef STORMPY_DISABLE_SIGNATURE_DOC
py::options options;
@ -11,5 +11,4 @@ PYBIND11_PLUGIN(dft) {
#endif
define_dft(m);
return m.ptr();
}

6
src/mod_expressions.cpp

@ -1,8 +1,8 @@
#include "common.h"
#include "storm/storage/expressions/ExpressionManager.h"
PYBIND11_PLUGIN(expressions) {
py::module m("expressions", "Storm expressions");
PYBIND11_MODULE(expressions, m) {
m.doc() = "Storm expressions";
#ifdef STORMPY_DISABLE_SIGNATURE_DOC
py::options options;
@ -18,6 +18,4 @@ PYBIND11_PLUGIN(expressions) {
.def_property_readonly("has_integer_type", &storm::expressions::Expression::hasIntegerType)
.def_property_readonly("has_rational_type", &storm::expressions::Expression::hasRationalType)
;
return m.ptr();
}

6
src/mod_info.cpp

@ -1,8 +1,9 @@
#include "common.h"
#include "storm/utility/storm-version.h"
PYBIND11_PLUGIN(info) {
py::module m("info", "Storm information");
PYBIND11_MODULE(info, m) {
m.doc() = "Storm information";
py::class_<storm::utility::StormVersion>(m, "Version", "Version information for Storm")
// static properties are still called with self as argument (which we ignore), see
// https://pybind11.readthedocs.io/en/master/advanced/classes.html#static-properties
@ -10,5 +11,4 @@ PYBIND11_PLUGIN(info) {
.def_property_readonly_static("long", [](py::object /* self */){ return storm::utility::StormVersion::longVersionString(); }, "Storm version in long representation")
.def_property_readonly_static("build_info", [](py::object /* self */){ return storm::utility::StormVersion::buildInfo(); }, "Build info for Storm")
;
return m.ptr();
}

5
src/mod_logic.cpp

@ -2,8 +2,8 @@
#include "logic/formulae.h"
PYBIND11_PLUGIN(logic) {
py::module m("logic", "Logic module for Storm");
PYBIND11_MODULE(logic, m) {
m.doc() = "Logic module for Storm";
#ifdef STORMPY_DISABLE_SIGNATURE_DOC
py::options options;
@ -11,5 +11,4 @@ PYBIND11_PLUGIN(logic) {
#endif
define_formulae(m);
return m.ptr();
}

5
src/mod_pars.cpp

@ -4,8 +4,8 @@
#include "pars/pla.h"
#include "pars/model_instantiator.h"
PYBIND11_PLUGIN(pars) {
py::module m("pars", "Functionality for parametric analysis");
PYBIND11_MODULE(pars, m) {
m.doc() = "Functionality for parametric analysis";
#ifdef STORMPY_DISABLE_SIGNATURE_DOC
py::options options;
@ -15,5 +15,4 @@ PYBIND11_PLUGIN(pars) {
define_pars(m);
define_pla(m);
define_model_instantiator(m);
return m.ptr();
}

5
src/mod_storage.cpp

@ -6,8 +6,8 @@
#include "storage/state.h"
#include "storage/labeling.h"
PYBIND11_PLUGIN(storage) {
py::module m("storage");
PYBIND11_MODULE(storage, m) {
m.doc() = "Data structures in Storm";
#ifdef STORMPY_DISABLE_SIGNATURE_DOC
py::options options;
@ -19,5 +19,4 @@ PYBIND11_PLUGIN(storage) {
define_sparse_matrix(m);
define_state(m);
define_labeling(m);
return m.ptr();
}

6
src/mod_utility.cpp

@ -2,8 +2,8 @@
#include "utility/shortestPaths.h"
PYBIND11_PLUGIN(utility) {
py::module m("utility", "Dumping ground of stuff that really should be somewhere more reasonable");
PYBIND11_MODULE(utility, m) {
m.doc() = "Utilities for Storm";
define_ksp(m);
return m.ptr();
}
Loading…
Cancel
Save