From e61df644c612dd9dfa0ee5a8e154eb8ef9e450ac Mon Sep 17 00:00:00 2001
From: Ian Bell <ian.bell@nist.gov>
Date: Thu, 1 Dec 2022 16:52:42 -0500
Subject: [PATCH] Fix building of mutants

---
 interface/pybind11_wrapper.cpp | 2 +-
 setup.py                       | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/interface/pybind11_wrapper.cpp b/interface/pybind11_wrapper.cpp
index 66c7481..6054024 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 1daa244..64b3f17 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
     
 '''
 
-- 
GitLab