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.
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 forr_max,er_max, andoer_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
TypeErrorinstead 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], andself.oer_max[key]to the corresponding model cutoff values.