Skip to content

Commit

Permalink
Change code according according to coderabbitai
Browse files Browse the repository at this point in the history
  • Loading branch information
Chengqian-Zhang committed Dec 15, 2024
1 parent 63cec86 commit 99df857
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/tests/common/test_out_stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 99df857

Please sign in to comment.