deepmodeling / deepmodeling/tbplas

[Code scan] Detect merge_prim_cell extended mismatches independent of argument order

Open
#20 0 comments 0 reactions 0 assignees View on GitHub
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: Low

`merge_prim_cell()` tries to reset `extended` to `1.0` when component cells have incompatible `extended` values, but it only checks `pc.extended - extended >= 1.e-3`. If the first cell has a larger value than a later cell, the difference is negative and the mismatch is missed.

Code reference:
https://github.com/deepmodeling/tbplas/blob/4d3652b3dba8eb930e4869a6d41074f62d703692/tbplas/builder/advanced.py#L363-L370

Suggested fix: compare with `abs(pc.extended - extended)`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.