diff --git a/interface/pybind11_wrapper.cpp b/interface/pybind11_wrapper.cpp index 66c74819489f65bd57515641cebeef36d4668397..6054024223273dfd9aaf907a1a61486a5a4649fc 100644 --- a/interface/pybind11_wrapper.cpp +++ b/interface/pybind11_wrapper.cpp @@ -53,7 +53,7 @@ void add_multifluid_mutant(py::module& m) { using MultiFluid = decltype(build_multifluid_model(std::vector<std::string>{"", ""}, "", "")); // Wrap the function for generating a multifluid mutant - m.def("build_multifluid_mutant", [](const py::object& o, const nlohmann::json &j){ + m.def("_build_multifluid_mutant", [](const py::object& o, const nlohmann::json &j){ const auto& model = std::get<MultiFluid>(o.cast<const AbstractModel *>()->get_model()); AllowedModels mutant{build_multifluid_mutant(model, j)}; return emplace_model(std::move(mutant)); diff --git a/setup.py b/setup.py index 1daa244a42d3f74f0197eda588e4d4bf4a0da5a0..64b3f17534a477df40ba0689b1498aaf6a3fb72b 100644 --- a/setup.py +++ b/setup.py @@ -84,7 +84,7 @@ init_template = r'''import os, warnings, functools # Bring all entities from the extension module into this namespace from .teqp import * -from .teqp import _make_model +from .teqp import _make_model, _build_multifluid_mutant def get_datapath(): """Get the absolute path to the folder containing the root of multi-fluid data""" @@ -209,6 +209,11 @@ def build_multifluid_model(components, coolprop_root, BIPcollectionpath = "", fl } } return make_model(j) + +def build_multifluid_mutant(*args, **kwargs): + AS = _build_multifluid_mutant(*args, **kwargs) + attach_model_specific_methods(AS) + return AS '''