From df61d4f076b2bf425a2873854fc5289e04b0a248 Mon Sep 17 00:00:00 2001 From: Lars Pastewka Date: Tue, 16 Jul 2024 22:26:34 +0200 Subject: [PATCH] TST: Fixed `test_committeeuncertainty_calculate` for recent changes to ASE readers --- tests/test_committee.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_committee.py b/tests/test_committee.py index 5c681e7de..1b07657e7 100644 --- a/tests/test_committee.py +++ b/tests/test_committee.py @@ -211,9 +211,13 @@ def test_committeeuncertainty_calculate(committee_calibrated): test_data = ase.io.read(os.path.join(f'{os.path.dirname(__file__)}/committee_data/test_data.xyz'), ':') for atoms_i in test_data: calculator.calculate(atoms=atoms_i, properties=['energy', 'forces']) - for prop_j in ['energy', 'energy_uncertainty']: + for prop_j in ['energy', 'forces']: + # energy and forces are read into the results dictionary of a SinglePointCalculator + np.testing.assert_array_almost_equal(calculator.results[prop_j], atoms_i.calc.results[prop_j], decimal=6, + err_msg=f'Missmatch in property \'{prop_j}\'') + for prop_j in ['energy_uncertainty']: np.testing.assert_array_almost_equal(calculator.results[prop_j], atoms_i.info[prop_j], decimal=6, err_msg=f'Missmatch in property \'{prop_j}\'') - for prop_j in ['forces', 'forces_uncertainty']: + for prop_j in ['forces_uncertainty']: np.testing.assert_array_almost_equal(calculator.results[prop_j], atoms_i.arrays[prop_j], decimal=6, err_msg=f'Missmatch in property \'{prop_j}\'')