Skip to content
Snippets Groups Projects
Commit dbc41e96 authored by Moritz's avatar Moritz
Browse files

Fixed data check in case log noise evidence is np.nan

parent c8d2c6af
No related branches found
No related tags found
1 merge request!459Combining results
Pipeline #59598 passed
......@@ -1295,7 +1295,8 @@ class ResultList(list):
raise CombineResultError("Cannot combine results: inconsistent parameters")
def _check_consistent_data(self):
if not np.all([res.log_noise_evidence == self[0].log_noise_evidence for res in self]):
if not np.all([res.log_noise_evidence == self[0].log_noise_evidence for res in self])\
and not np.all([np.isnan(res.log_noise_evidence) for res in self]):
raise CombineResultError("Cannot combine results: inconsistent data")
def _check_consistent_sampler(self):
......
......@@ -508,6 +508,11 @@ class TestResultList(unittest.TestCase):
with self.assertRaises(bilby.result.CombineResultError):
self.nested_results.combine()
def test_combine_inconsistent_data_nan(self):
self.nested_results[0].log_noise_evidence = np.nan
self.nested_results[1].log_noise_evidence = np.nan
self.nested_results.combine()
def test_combine_inconsistent_sampling_data(self):
result = bilby.core.result.Result(
label=self.label, outdir=self.outdir, sampler='cpnest',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment