Skip to content

Commit 711a1f4

Browse files
author
Han Wang
committed
fix(test): export test models with atomic_virial=True for .pte/.pt2
The test_models.py tests compare per-atom virial against reference values that include the atomic virial correction. Since convert_backend now defaults to atomic_virial=False for performance, test model generation must explicitly request atomic_virial=True.
1 parent 8a9fe63 commit 711a1f4

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

source/tests/infer/case.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,12 @@ def get_model(self, suffix: str, out_file: str | None = None) -> str:
173173
out_file = tempfile.NamedTemporaryFile(
174174
suffix=suffix, dir=tempdir.name, delete=False, prefix=self.key + "_"
175175
).name
176-
convert_backend(INPUT=self.filename, OUTPUT=out_file)
176+
# For .pte/.pt2, export with atomic virial so tests can verify
177+
# per-atom virial against reference values.
178+
kwargs: dict = {}
179+
if suffix in (".pte", ".pt2"):
180+
kwargs["atomic_virial"] = True
181+
convert_backend(INPUT=self.filename, OUTPUT=out_file, **kwargs)
177182
return out_file
178183

179184

0 commit comments

Comments
 (0)