Skip to content

[Fix] Include #TOTAL ENERGY# check in get_energy function of abacus/[md,relax].py#950

Open
ZhouXY-PKU wants to merge 2 commits intodeepmodeling:masterfrom
ZhouXY-PKU:patch-2
Open

[Fix] Include #TOTAL ENERGY# check in get_energy function of abacus/[md,relax].py#950
ZhouXY-PKU wants to merge 2 commits intodeepmodeling:masterfrom
ZhouXY-PKU:patch-2

Conversation

@ZhouXY-PKU
Copy link
Contributor

@ZhouXY-PKU ZhouXY-PKU commented Mar 12, 2026

Fix #949.

Summary by CodeRabbit

  • Bug Fixes
    • Improved energy extraction from ABACUS MD logs to recognize additional energy markers, ensuring energy values are captured reliably across varied log formats and maintaining correct alignment with structure snapshots.

Signed-off-by: Levi Zhou  <31941107+ZhouXY-PKU@users.noreply.github.com>
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 12, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 12, 2026

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 2 untouched benchmarks


Comparing ZhouXY-PKU:patch-2 (6c19c19) with master (d68b700)

Open in CodSpeed

@dosubot dosubot bot added abacus bug Something isn't working labels Mar 12, 2026
@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.37%. Comparing base (d68b700) to head (6c19c19).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #950   +/-   ##
=======================================
  Coverage   86.37%   86.37%           
=======================================
  Files          86       86           
  Lines        8086     8086           
=======================================
  Hits         6984     6984           
  Misses       1102     1102           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

📝 Walkthrough

Walkthrough

Extended energy parsing in ABACUS parsers to also recognize lines containing "#TOTAL ENERGY#" alongside "final etot is" in MD and relax log processing; recording and indexing behavior for energies remain unchanged.

Changes

Cohort / File(s) Summary
ABACUS energy parsing
dpdata/abacus/md.py, dpdata/abacus/relax.py
Expanded energy-line detection to accept the "#TOTAL ENERGY#" marker in addition to "final etot is" when extracting energies from ABACUS log files; preserves existing dump-frequency handling and energy indexing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

Suggested reviewers

  • pxlxingliang
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The changes successfully address issue #949 by extending energy parsing to recognize both old (final etot is) and new (#TOTAL ENERGY#) keywords, ensuring extracted energies match MD_dump frames.
Out of Scope Changes check ✅ Passed Both changes are strictly scoped to energy parsing in abacus/md.py and abacus/relax.py, directly addressing the energy keyword incompatibility reported in issue #949.
Title check ✅ Passed The title accurately describes the main change: adding support for '#TOTAL ENERGY#' energy line detection in the abacus/md.py and abacus/relax.py modules to fix energy parsing.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

Migrating from UI to YAML configuration.

Use the @coderabbitai configuration command in a PR comment to get a dump of all your UI settings in YAML format. You can then edit this YAML file and upload it to the root of your repository to configure CodeRabbit programmatically.

@ZhouXY-PKU ZhouXY-PKU changed the title Include total energy check in get_energy function [Fix] Include #TOTAL ENERGY# check in get_energy function Mar 12, 2026
@ZhouXY-PKU ZhouXY-PKU changed the title [Fix] Include #TOTAL ENERGY# check in get_energy function [Fix] Include #TOTAL ENERGY# check in get_energy function of abacus/md.py Mar 12, 2026
Signed-off-by: Levi Zhou  <31941107+ZhouXY-PKU@users.noreply.github.com>
@ZhouXY-PKU ZhouXY-PKU changed the title [Fix] Include #TOTAL ENERGY# check in get_energy function of abacus/md.py [Fix] Include #TOTAL ENERGY# check in get_energy function of abacus/[md,relax].py Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

abacus bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Dpdata failed to process abacus/md (the develop branch of abacus)

1 participant