deepmodeling / deepmodeling/dpti
[Code scan] POSCAR utilities drop standard unlabeled coordinate lines
- Dominant language
- Python
- Stars
- 42
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
Source: Codex global repository scan of deepmodeling/dpti at commit b719828e7eeb571bd26411430197cd74ea78e38c.
Project: https://github.com/orgs/deepmodeling/projects/27
Problem
`regulate_poscar()` and `sort_poscar()` infer each coordinate line's element from the last token of the coordinate line. Normal POSCAR coordinate lines usually do not include element labels, because species and counts are already in the header. For those standard files, the utilities can drop all positions while still writing a header.
Code references
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/lib/vasp.py#L20
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/lib/vasp.py#L25
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/lib/vasp.py#L47
https://github.com/deepmodeling/dpti/blob/b719828e7eeb571bd26411430197cd74ea78e38c/dpti/lib/vasp.py#L52
Reproduction
Use a POSCAR with species `O H O`, counts `1 2 1`, and four unlabeled `Direct` coordinate lines. The output should retain four positions, but the current filtering expects the last coordinate token to be an element name.
Expected result
The utilities should derive element ownership from the header counts, or clearly require and validate labeled coordinate lines.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in dpti/lib/vasp.py at the referenced lines in regulate_poscar() and sort_poscar(), then reproduce the issue with the described POSCAR containing species O H O, counts 1 2 1, and four unlabeled Direct coordinate lines. Determine how the header counts relate positions to species, or validate the labeled-line requirement; done means both utilities retain all four positions without writing an inconsistent header.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100