deepmodeling / deepmodeling/tbplas
[Code scan] Make find_neighbors handle mixed PrimitiveCell and SuperCell inputs
- Dominant language
- No language data
- Stars
- 19
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
This issue comes from a Codex global scan of deepmodeling/tbplas at commit 4d3652b3dba8eb930e4869a6d41074f62d703692.
Severity: Medium
The signature allows `cell_bra` and `cell_ket` to be either `PrimitiveCell` or `SuperCell`, but the implementation dispatches position access mostly from the type of `cell_bra`. Mixed calls such as primitive-to-supercell or supercell-to-primitive can therefore call attributes/methods that do not exist on `cell_ket`.
Code reference:
https://github.com/deepmodeling/tbplas/blob/4d3652b3dba8eb930e4869a6d41074f62d703692/tbplas/builder/advanced.py#L402-L451
Suggested fix: resolve orbital positions independently for `cell_bra` and `cell_ket`, or narrow the accepted API and validate unsupported mixed-type calls explicitly.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.