Skip to content

Fix CP2K 2025 stress parsing in bar - #100

Open
SchrodingersCattt wants to merge 1 commit into
robinzyb:mainfrom
SchrodingersCattt:fix/cp2k-2025-bar-stress
Open

SchrodingersCattt wants to merge 1 commit into
robinzyb:mainfrom
SchrodingersCattt:fix/cp2k-2025-bar-stress

Conversation

@SchrodingersCattt

Copy link
Copy Markdown

Summary

  • accept analytical stress tensor headers in both GPa and bar
  • normalize bar values to GPa in the block parser before the existing dpdata virial conversion
  • add a regression test showing equivalent GPa and bar tensors produce identical parsed values

Why

CP2K 2025.x may print STRESS| Analytical stress tensor [bar]. The previous GPa-only regex did not match that block, so cp2kdata/e_f silently omitted virials while retaining the other labels.

Tests

pytest -q tests/test_stress.py tests/test_energy_force/test_energy_force.py tests/test_dpdata/test_labeledsys.py
260 passed

Fixes #99. Related to #98.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CP2K 2025 [bar] stress is silently omitted from dpdata virials

1 participant