feat(quip/gap/xyz): implement to_labeled_system and to_multi_systems methods with file handler support#888
Conversation
…methods Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
to_labeled_system and to_multi_systems for QuipGapXYZFormat…r reviewer feedback Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
…ove import organization Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
for more information, see https://pre-commit.ci
CodSpeed WallTime Performance ReportMerging #888 will not alter performanceComparing Summary
Footnotes |
|
@copilot Fix unit tests. Fix pre-commit errors. |
…sitioning correctly Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
Fixed unit tests and addressed the file handler positioning issue. The problem was that when multiple systems were written to the same file handler via |
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devel #888 +/- ##
==========================================
+ Coverage 85.84% 85.94% +0.10%
==========================================
Files 82 82
Lines 7706 7754 +48
==========================================
+ Hits 6615 6664 +49
+ Misses 1091 1090 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ystem export Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
Implements export functionality for QUIP/GAP XYZ format with support for both file paths and file handlers.
Key Features
to_labeled_systemwrites individual systems to QUIP/GAP XYZ formatto_multi_systemsyields file handlers for writing multiple systems to a single fileImplementation Details
The
to_multi_systemsmethod uses a generator pattern that yields file handlers instead of filenames, enabling more flexible file management. Theto_labeled_systemmethod handles both file paths and file handlers appropriately, with different write modes for each.When writing multiple systems to the same file handler, configurations are written directly adjacent to each other without separator lines, matching the standard QUIP/GAP XYZ format specification.
Testing
Comprehensive test suite covers:
This maintains full backward compatibility while adding the requested export capabilities.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.