deepmodeling / deepmodeling/dftio

[Code scan] Replace the broken Gaussian eigenvalue stub and cast Gaussian structure dtypes

Open
#33 0 comments 0 reactions 0 assignees View on GitHub
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
The Gaussian parser has a public eigenvalue method stub with the wrong signature and an undefined name:

https://github.com/deepmodeling/dftio/blob/c9d128f24a74ef2911e1a28f5640357488beb196/dftio/io/gaussian/gaussian_parser.py#L46-L47

The shared writer calls parser methods with `idx` and `band_index_min`, so `write_dat(..., eigenvalue=True)` on Gaussian raises a signature error. Direct `get_eigenvalue()` raises `NameError` because `psas` is undefined.

The same parser also returns ASE atomic numbers without casting to the dtype required by the shared structure checker:

https://github.com/deepmodeling/dftio/blob/c9d128f24a74ef2911e1a28f5640357488beb196/dftio/io/gaussian/gaussian_parser.py#L38-L43

The checker requires `np.int32`:

https://github.com/deepmodeling/dftio/blob/c9d128f24a74ef2911e1a28f5640357488beb196/dftio/io/parse.py#L169-L173

Other parsers cast atomic numbers explicitly.

## Suggested fix
Either implement `get_eigenvalue(self, idx, band_index_min=0)` or make it raise a clear `NotImplementedError` with the correct signature. Also cast Gaussian atomic numbers with `atoms.numbers.astype(np.int32)`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.