deepmodeling / deepmodeling/dftio
[Code scan] Make RESCU eigenvalue parsing compatible with the shared writer
- Dominant language
- Jupyter Notebook
- Stars
- 16
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
This issue comes from a Codex global repository scan.
## Problem
`RescuParser.get_eigenvalue()` is incompatible with the shared writer/checker contract:
https://github.com/deepmodeling/dftio/blob/c9d128f24a74ef2911e1a28f5640357488beb196/dftio/io/rescu/rescu_parser.py#L74-L85
The shared writer passes `band_index_min`:
https://github.com/deepmodeling/dftio/blob/c9d128f24a74ef2911e1a28f5640357488beb196/dftio/io/parse.py#L263-L267
The checker requires k-points shaped `(n_kpt, 3)`:
https://github.com/deepmodeling/dftio/blob/c9d128f24a74ef2911e1a28f5640357488beb196/dftio/io/parse.py#L184-L190
Currently the RESCU method lacks the `band_index_min` argument and returns k-points with shape `(1, nk, 3)`, so `write_dat(..., eigenvalue=True)` raises `TypeError`, and direct checker usage fails shape validation.
## Suggested fix
Add `band_index_min=0`, slice bands consistently, return k-points as `(nk, 3)`, and cast both arrays to `float32`.
Contributor guide
Research direction
Start in dftio/io/rescu/rescu_parser.py at RescuParser.get_eigenvalue(), then compare its interface and outputs with dftio/io/parse.py:263-267 and the checker at lines 184-190. Make the method accept band_index_min, slice bands consistently, return k-points shaped (n_kpt, 3), and cast both arrays to float32. Done means write_dat(..., eigenvalue=True) no longer raises the argument error and the checker accepts the k-point shape.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-engineering
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100