Skip to content

Commit 808b9c7

Browse files
author
Han Wang
committed
fix: address remaining reviewer comments
- test_change_bias: assert full bias tensor shape, not just first 2 values - test_dp_freeze: clarify NoPBC test compares independent implementations
1 parent 196bcca commit 808b9c7

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

source/tests/pt_expt/test_change_bias.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,8 @@ def test_change_bias_frozen_pt2_user_defined(self) -> None:
312312
updated_model = BaseModel.deserialize(updated_data["model"])
313313
updated_bias = to_numpy(updated_model.get_out_bias())
314314

315-
np.testing.assert_allclose(updated_bias.flatten()[:2], [1.0, 2.0], atol=1e-10)
315+
expected = np.array([[1.0], [2.0]])
316+
np.testing.assert_allclose(updated_bias, expected, atol=1e-10)
316317

317318
def test_change_bias_pt2_pte_consistency(self) -> None:
318319
"""Change-bias on .pte and .pt2 should produce same bias values."""

source/tests/pt_expt/test_dp_freeze.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ def test_freeze_pt2_nopbc_negative_coords(self) -> None:
161161
162162
Regression test: the C++ NoPBC path creates a fake box and must
163163
shift coordinates so atoms with negative values are inside [0, L).
164+
Compares .pt2 (C++ fake-box path) against .pte (Python no-ghost path)
165+
— these are independent NoPBC implementations so cross-comparison
166+
validates both.
164167
"""
165168
import numpy as np
166169

0 commit comments

Comments
 (0)