diff --git a/RATapi/outputs.py b/RATapi/outputs.py index bfd7f521..4c4a00a0 100644 --- a/RATapi/outputs.py +++ b/RATapi/outputs.py @@ -149,6 +149,7 @@ class DreamOutput(RATResult): @dataclass class NestedSamplerOutput(RATResult): logZ: float + logZErr: float nestSamples: np.ndarray postSamples: np.ndarray @@ -230,6 +231,7 @@ def make_results( nested_sampler_output = NestedSamplerOutput( logZ=bayes_results.nestedSamplerOutput.logZ, + logZErr=bayes_results.nestedSamplerOutput.logZErr, nestSamples=bayes_results.nestedSamplerOutput.nestSamples, postSamples=bayes_results.nestedSamplerOutput.postSamples, ) diff --git a/cpp/RAT b/cpp/RAT index a623fd32..af251ab2 160000 --- a/cpp/RAT +++ b/cpp/RAT @@ -1 +1 @@ -Subproject commit a623fd32ce0cceefa839f704bf6c51f519493145 +Subproject commit af251ab27ebce5ab58ba27004eea541dae438785 diff --git a/cpp/rat.cpp b/cpp/rat.cpp index 37f57375..0f370368 100644 --- a/cpp/rat.cpp +++ b/cpp/rat.cpp @@ -315,6 +315,7 @@ struct ConfidenceIntervals struct NestedSamplerOutput { real_T logZ; + real_T logZErr; py::array_t nestSamples; py::array_t postSamples; }; @@ -1243,6 +1244,7 @@ BayesResults bayesResultsFromStruct9T(const RAT::struct9_T results) bayesResults.confidenceIntervals.mean = pyArrayFromRatArray2d(results.confidenceIntervals.mean); bayesResults.nestedSamplerOutput.logZ = results.nestedSamplerOutput.LogZ; + bayesResults.nestedSamplerOutput.logZErr = results.nestedSamplerOutput.LogZErr; bayesResults.nestedSamplerOutput.nestSamples = pyArrayFromRatArray2d(results.nestedSamplerOutput.nestSamples); bayesResults.nestedSamplerOutput.postSamples = pyArrayFromRatArray2d(results.nestedSamplerOutput.postSamples); @@ -1445,6 +1447,7 @@ PYBIND11_MODULE(rat_core, m) { py::class_(m, "NestedSamplerOutput") .def(py::init<>()) .def_readwrite("logZ", &NestedSamplerOutput::logZ) + .def_readwrite("logZErr", &NestedSamplerOutput::logZErr) .def_readwrite("nestSamples", &NestedSamplerOutput::nestSamples) .def_readwrite("postSamples", &NestedSamplerOutput::postSamples); diff --git a/tests/conftest.py b/tests/conftest.py index ecd9ddd6..0f81fdb2 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -5639,6 +5639,7 @@ def dream_results(): ), nestedSamplerOutput=RATapi.outputs.NestedSamplerOutput( logZ=0.0, + logZErr=0.0, nestSamples=np.array([[0.0, 0.0]]), postSamples=np.array([[0.0, 0.0]]), ), diff --git a/tests/test_outputs.py b/tests/test_outputs.py index fdd22dd7..e5758a4f 100644 --- a/tests/test_outputs.py +++ b/tests/test_outputs.py @@ -126,6 +126,7 @@ def dream_str(): "),\n" "nestedSamplerOutput = NestedSamplerOutput(\n" "\tlogZ = 0.0,\n" + "\tlogZErr = 0.0,\n" "\tnestSamples = Data array: [1 x 2],\n" "\tpostSamples = Data array: [1 x 2],\n" "),\n"