deepmodeling / deepmodeling/DeePTB

[Code scan] Dict cutoff validation compares whole dataset dicts to scalar model cutoffs

Open
#354 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
122
Forks
36
PR merge metrics
No merged PRs in 30d

Description

This issue is part of a Codex global repository scan.

Problem:
When model cutoffs are dictionaries, `check_cutoffs()` verifies that each key exists in the dataset cutoff dict, but then compares the whole dataset dict to a scalar value. The same pattern appears for `r_max`, `er_max`, and `oer_max`.

Code references:
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/data/build.py#L334-L340
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/data/build.py#L346-L353
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/data/build.py#L362-L369

Impact:
Valid dict-mode cutoff configurations raise `TypeError` instead of being validated, so model/dataset compatibility checks fail for per-type or per-bond cutoff settings.

Suggested fix:
Compare `self.r_max[key]`, `self.er_max[key]`, and `self.oer_max[key]` to the corresponding model cutoff values.

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.