From 99df8577fc7c4a742816523fcb67a6f36da4de1d Mon Sep 17 00:00:00 2001 From: root <2000011006@stu.pku.edu.cn> Date: Mon, 16 Dec 2024 00:51:30 +0800 Subject: [PATCH] Change code according according to coderabbitai --- source/tests/common/test_out_stat.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/tests/common/test_out_stat.py b/source/tests/common/test_out_stat.py index a1df97b9bb..253872361c 100644 --- a/source/tests/common/test_out_stat.py +++ b/source/tests/common/test_out_stat.py @@ -91,7 +91,13 @@ def test_compute_stats_from_redu_with_assigned_bias(self) -> None: ) def test_compute_stats_property(self) -> None: + """Test compute_stats_property function with various scenarios.""" bias, std = compute_stats_property(self.output_redu, self.natoms) + # Test shapes + assert bias.shape == (len(self.mean), self.output_redu.shape[1]) + assert std.shape == (self.output_redu.shape[1],) + + # Test values for fake_atom_bias in bias: np.testing.assert_allclose( fake_atom_bias, np.mean(self.output_redu, axis=0), rtol=1e-7