support to read coord/cell from STRU_ION*_D in abacus/relax#957
support to read coord/cell from STRU_ION*_D in abacus/relax#957wanghan-iapcm merged 13 commits intodeepmodeling:masterfrom
Conversation
for more information, see https://pre-commit.ci
Merging this PR will degrade performance by 14.24%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | WallTime | test_import |
9.8 ms | 11.4 ms | -14.24% |
Comparing pxlxingliang:abacus-relax (d3f5707) with master (80abfc5)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (12)
✅ Files skipped from review due to trivial changes (5)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR fixes the issue where only the first frame was read from ABACUS relaxation trajectories. It adds discovery of Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
tests/test_abacus_relax.py (1)
198-200: Please remove commented-out artifact generation code.This is test-debug residue and can be dropped to keep the suite clean.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/test_abacus_relax.py` around lines 198 - 200, Remove the commented-out test artifact generation block (the np.save loop) so the test no longer contains leftover debug code; specifically delete the commented lines that iterate over the keys list ["energies", "cells", "coords", "forces", "stress", "virials"] and call np.save with self.system.data (the commented np.save(...) lines), leaving only the functional test code intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@dpdata/abacus/relax.py`:
- Around line 134-138: get_frame_from_stru returns coordinates/cells in Angstrom
but later code multiplies all frames by bohr2ang, causing STRU-derived frames to
be double-scaled; modify the block that assigns stru-derived data (where
coords[iframe] and cells[iframe] are set from get_frame_from_stru) to normalize
those values back to Bohr (divide by bohr2ang) so the later common conversion is
correct; reference get_frame_from_stru, coords, cells, bohr2ang, stru_files,
stru_file_name, and iframe when locating the change.
- Line 51: Replace the mutable default argument in get_coords_from_log: change
the signature from stru_files=[] to stru_files=None and inside the function set
stru_files = [] if stru_files is None; update any downstream logic that assumes
stru_files is a list to use the initialized local list to avoid shared-state
bugs caused by the original mutable default.
---
Nitpick comments:
In `@tests/test_abacus_relax.py`:
- Around line 198-200: Remove the commented-out test artifact generation block
(the np.save loop) so the test no longer contains leftover debug code;
specifically delete the commented lines that iterate over the keys list
["energies", "cells", "coords", "forces", "stress", "virials"] and call np.save
with self.system.data (the commented np.save(...) lines), leaving only the
functional test code intact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3ee3a62b-cd30-4386-a867-f3e832e6c647
⛔ Files ignored due to path filters (1)
tests/abacus.relax.readFromSTRUIOND/OUT.ABACUS/running_cell-relax.logis excluded by!**/*.log
📒 Files selected for processing (17)
dpdata/abacus/relax.pytests/abacus.relax.readFromSTRUIOND/INPUTtests/abacus.relax.readFromSTRUIOND/KPTtests/abacus.relax.readFromSTRUIOND/OUT.ABACUS/STRU_ION1_Dtests/abacus.relax.readFromSTRUIOND/OUT.ABACUS/STRU_ION2_Dtests/abacus.relax.readFromSTRUIOND/OUT.ABACUS/STRU_ION3_Dtests/abacus.relax.readFromSTRUIOND/OUT.ABACUS/STRU_ION4_Dtests/abacus.relax.readFromSTRUIOND/OUT.ABACUS/STRU_ION5_Dtests/abacus.relax.readFromSTRUIOND/OUT.ABACUS/STRU_ION_Dtests/abacus.relax.readFromSTRUIOND/STRUtests/abacus.relax.readFromSTRUIOND/cells.npytests/abacus.relax.readFromSTRUIOND/coords.npytests/abacus.relax.readFromSTRUIOND/energies.npytests/abacus.relax.readFromSTRUIOND/forces.npytests/abacus.relax.readFromSTRUIOND/stress.npytests/abacus.relax.readFromSTRUIOND/virials.npytests/test_abacus_relax.py
…into abacus-relax
for more information, see https://pre-commit.ci
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #957 +/- ##
==========================================
+ Coverage 86.63% 86.65% +0.02%
==========================================
Files 86 86
Lines 8006 8019 +13
==========================================
+ Hits 6936 6949 +13
Misses 1070 1070 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@pyproject.toml`:
- Around line 27-28: The conditional lmdb dependency lines ('lmdb>=0.98,<1;
python_version < "3.9"' and 'lmdb; python_version >= "3.9"') are unrelated to
this PR’s purpose—either revert this change so the pyproject.toml keeps the
original lmdb spec, or move the version-constraint change into its own PR with a
short rationale; if you intentionally changed it here, add a brief comment in
the PR description explaining why Python <3.9 must be pinned to <1 while >=3.9
is unpinned, referencing the lmdb lines so reviewers can find them easily.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6086c0a3-1217-4e32-8508-a21f99233351
📒 Files selected for processing (2)
dpdata/abacus/relax.pypyproject.toml
fix #951
Summary by CodeRabbit
New Features
Tests
Chores