ITADN

[Code scan] Complete CALYPSO safe-distance handling for common elements

#353Opennjzjz 创建于 2026-06-30
bug
N
njzjzcommented
Found by Codex global repository scan of `deepmodeling/dpgen2` at commit `2679611a3704f5c2646c8cb353e34177518db758`. `parse_traj` filters selected CALYPSO frames with a hard-coded safe-distance table: https://github.com/deepmodeling/dpgen2/blob/2679611a3704f5c2646c8cb353e34177518db758/dpgen2/op/run_caly_model_devi.py#L239-L267 The table is indexed directly for every atom pair: https://github.com/deepmodeling/dpgen2/blob/2679611a3704f5c2646c8cb353e34177518db758/dpgen2/op/run_caly_model_devi.py#L299-L314 Many common elements are missing, including `O`, `N`, `F`, `Cl`, `Fe`, `Ni`, and `Cu`. A trajectory containing any omitted element raises `KeyError` before model-deviation output is written. Suggested fix: use a complete element table from a maintained source, fall back with a clear validation error, or reuse the covalent-radius data already present elsewhere in the package. Add a regression test with an element currently missing from the dictionary.
0 条评论