Skip to content
Snippets Groups Projects
Commit 14499abb authored by Colm Talbot's avatar Colm Talbot
Browse files

Merge branch 'data-consistency-test-clarity' into 'master'

MAINT: clarify the data consistency test

See merge request !1174
parents ef774fb6 b9f02c9e
No related branches found
No related tags found
1 merge request!1174MAINT: clarify the data consistency test
Pipeline #473318 passed with warnings
......@@ -1882,9 +1882,13 @@ class ResultList(list):
self._error_or_warning_consistency(msg)
def check_consistent_data(self):
if not np.allclose([res.log_noise_evidence for res in self], self[0].log_noise_evidence, atol=1e-8, rtol=0.0)\
and not np.all([np.isnan(res.log_noise_evidence) for res in self]):
if not np.allclose(
[res.log_noise_evidence for res in self],
self[0].log_noise_evidence,
atol=1e-8,
rtol=0.0,
equal_nan=True,
):
msg = "Inconsistent data between results"
self._error_or_warning_consistency(msg)
......
......@@ -635,11 +635,16 @@ class TestResultListError(unittest.TestCase):
with self.assertRaises(bilby.result.ResultListError):
self.nested_results.combine()
def test_combine_inconsistent_data_nan(self):
def test_combine_data_all_nan_consistent(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_data_one_nan(self):
self.nested_results[0].log_noise_evidence = np.nan
with self.assertRaises(bilby.result.ResultListError):
self.nested_results.combine()
def test_combine_inconsistent_sampling_data(self):
result = bilby.core.result.Result(
label=self.label,
......
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