feat(lammps): implement to_system method for LAMMPSDumpFormat#882
Merged
wanghan-iapcm merged 2 commits intodevelfrom Aug 31, 2025
Merged
feat(lammps): implement to_system method for LAMMPSDumpFormat#882wanghan-iapcm merged 2 commits intodevelfrom
wanghan-iapcm merged 2 commits intodevelfrom
Conversation
Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] the structure file lammps.lmp can not be transformed to lammps.dump
feat(lammps): implement to_system method for LAMMPSDumpFormat
Aug 29, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devel #882 +/- ##
==========================================
+ Coverage 85.45% 85.84% +0.39%
==========================================
Files 82 82
Lines 7678 7706 +28
==========================================
+ Hits 6561 6615 +54
+ Misses 1117 1091 -26 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
wanghan-iapcm
approved these changes
Aug 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements the missing
to_systemmethod for theLAMMPSDumpFormatclass, enabling conversion from LAMMPS .lmp files to .dump format.Problem
Previously, users could not convert LAMMPS data files (.lmp) to dump format (.dump) because the
LAMMPSDumpFormatclass only supported reading dump files (from_system) but not writing them (to_system). This resulted in aNotImplementedErrorwhen attempting the conversion:Solution
Added the missing functionality by:
Implementing
from_system_data()function indpdata/lammps/dump.pythat converts system data to LAMMPS dump format string with proper:Adding
to_system()method toLAMMPSDumpFormatclass that uses the new conversion functionAdding comprehensive tests to verify the conversion works correctly and maintains data integrity
Verification
Example Usage
Fixes #664.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.