Skip to content

fix(vasp): skip malformed OUTCAR force frames#1030

Open
njzjz-bot wants to merge 1 commit into
deepmodeling:masterfrom
njzjz-bot:fix/issue-611
Open

fix(vasp): skip malformed OUTCAR force frames#1030
njzjz-bot wants to merge 1 commit into
deepmodeling:masterfrom
njzjz-bot:fix/issue-611

Conversation

@njzjz-bot

Copy link
Copy Markdown
Contributor

Fixes #611.

Parse TOTAL-FORCE blocks transactionally and skip separator/truncated ionic frames while retaining valid frames.

Tests: cd tests && python -m unittest test_vasp_outcar

Why existing tests missed it: All prior OUTCAR fixtures had complete numeric force tables; separators and EOF truncation were absent.

Coding agent: Codex
Codex version: codex-cli 0.144.4
Model: gpt-5.6-sol
Reasoning effort: xhigh

Parse TOTAL-FORCE rows transactionally and skip only the damaged ionic frame when a separator or end of file appears before all atoms are written.

Existing fixtures contain only complete force tables, so they never exercised the parser's unconditional ntot-row indexing or float conversion. Add regressions for both an early separator and a truncated final table.

Coding-Agent: Codex
Codex-Version: codex-cli 0.144.4
Model: gpt-5.6-sol
Reasoning-Effort: xhigh
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working dpdata vasp labels Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@njzjz-bot, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a6038744-dba7-4473-b991-76234ce3a86b

📥 Commits

Reviewing files that changed from the base of the PR and between 0416b54 and 335920f.

📒 Files selected for processing (2)
  • dpdata/formats/vasp/outcar.py
  • tests/test_vasp_outcar.py

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.

@codspeed-hq

codspeed-hq Bot commented Jul 16, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 20.15%

⚠️ 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.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 2 improved benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime test_import 11.8 ms 9.6 ms +22.37%
WallTime test_cli 386.7 ms 327.8 ms +17.97%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing njzjz-bot:fix/issue-611 (335920f) with master (0416b54)

Open in CodSpeed

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.65217% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.89%. Comparing base (0416b54) to head (335920f).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
dpdata/formats/vasp/outcar.py 95.65% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1030      +/-   ##
==========================================
+ Coverage   86.87%   86.89%   +0.01%     
==========================================
  Files          89       89              
  Lines        8266     8284      +18     
==========================================
+ Hits         7181     7198      +17     
- Misses       1085     1086       +1     

☔ View full report in Codecov by Harness.
📢 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.

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

Labels

bug Something isn't working dpdata size:M This PR changes 30-99 lines, ignoring generated files. vasp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] could not convert string to float

1 participant