Added own scripts: getPOTCAR.sh, plotHOMA_withPBC.py and xyz2POSCAR.py#15
Conversation
patrickmelix
left a comment
There was a problem hiding this comment.
Nice additions Jakob — the POTCAR script in particular fills a common workflow gap. A couple of inline suggestions.
There was a problem hiding this comment.
Pull request overview
Adds three new utilities to the tools4vasp toolkit for common VASP workflows: generating a POTCAR matching POSCAR element order, inserting an XYZ molecule into a POSCAR cell, and computing/plotting HOMA (with a PBC plotting workaround). It also updates the README tool list to mention the new commands.
Changes:
- Added
xyz2POSCAR.pyfor inserting/centering/sorting/constraining and optionally rotating an XYZ molecule into a POSCAR-defined cell. - Added
plotHOMA_withPBC.pyto compute HOMA values and generate a 2D plot, with optional PBC tiling for visualization. - Added
bash_scripts/getPOTCAR.shto assemble a POTCAR from a POSCAR’s element ordering; updated README to document new tools.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 19 comments.
| File | Description |
|---|---|
src/tools4vasp/xyz2POSCAR.py |
New CLI-like script to create a POSCAR from an XYZ molecule and a reference cell. |
src/tools4vasp/plotHOMA_withPBC.py |
New script to compute/plot HOMA and optionally replicate atoms for PBC plotting. |
src/tools4vasp/bash_scripts/getPOTCAR.sh |
New bash utility to concatenate POTCARs in POSCAR element order. |
README.md |
Documents the new tools in the command list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
patrickmelix
left a comment
There was a problem hiding this comment.
A few more items that Copilot correctly caught.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
xyz2POSCAR.py: - Remove leftover max(solution) lines before norm_val fix - Fix typo "Molacular" → "Molecular" - Add format='vasp' to mol.write() for reliable POSCAR output getPOTCAR.sh: - Fix typo "creats" → "creates" - Remove Fr from "None" group in help text (it belongs in "sv") plotHOMA_withPBC.py: - Guard against empty cycles list (IndexError on acyclic systems) - Fix uninitialized factor/digit when distance == d_opt exactly - Remove trailing comma after argparse line Co-Authored-By: Patrick Melix <chemistry@melix.me>
getPOTCAR, xyz2POSCAR, and plotHOMA_withPBC are not wired as console scripts in pyproject.toml yet. Add footnote so users know to run them directly from the repo checkout. Co-Authored-By: Patrick Melix <chemistry@melix.me>
… tests xyz2POSCAR.py: - Rename main() → run(), add new main() with argparse - Now installable as `xyz2POSCAR` console command plotHOMA_withPBC.py: - Rename main() → run(), add new main() with argparse - Now installable as `plotHOMA_withPBC` console command pyproject.toml: - Register xyz2POSCAR and plotHOMA_withPBC as entry points README.md: - Remove non-installable footnotes for xyz2POSCAR and plotHOMA_withPBC - Keep footnote only for getPOTCAR (bash script) test_coverage.py: - 4 tests for xyz2POSCAR: basic run, rotation, constraints, main() CLI - 3 tests for plotHOMA_withPBC: benzene ring, empty cycles error, main() CLI Co-Authored-By: Patrick Melix <chemistry@melix.me>
Add getPOTCAR.py that forwards CLI args to getPOTCAR.sh via subprocess, following the same pattern as calc_deformation_density.py. Register as console script in pyproject.toml so `getPOTCAR` is available after `pip install`. Remove the non-installable footnote from README — all tools are now installable console commands. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
a64b610 to
c121ac0
Compare
Resolve conflicts by taking main's version for plotHOMA_withPBC.py, xyz2POSCAR.py, and README.md (no branch-specific changes). Keep branch version of getPOTCAR.sh (env-var logic). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
getPOTCAR.sh - Generate POTCAR with same order of elements as specified in POSCAR.
plotHOMA_withPBC.py - Calculate and plot HOMA from coordinates, including pbc.
xyz2POSCAR.py - Insert molecule from .xyz file into a cell from a POSCAR.