Commit cdad312
fix(dptest): Wrong dptest results except for energy head (#4280)
Solve issue #4249
In `/deepmd/entrypoints/test.py` line 127 `tmap = dp.get_type_map() if
isinstance(dp, DeepPot) else None`. If we use `DeepProperty` or
`DeepPolar` or `DeepDOS`..... `tmap` is None. So `type_map` is not
modified again according to `type_map` in `input.json`. So `atype` is
wrong in the model forward process. The model prediction value is wrong.
According to @njzjz , It seems that in the `r2` branch, `get_type_map()`
is only available in `DeepPot`. After we refactor `DeepEval` in v3, this
should not be a problem anymore.
I also change the order of `type_map` in UT to ensure that when
`type_map` of `input.json` doesn't match the `type_map ` of data, the
result of the dptest is still correct.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Introduced warning logs for unsupported `DeepGlobalPolar` model usage,
recommending the `DeepPolar` model instead.
- **Bug Fixes**
- Simplified logic for obtaining the type map, ensuring consistent
retrieval from the updated source.
- Adjusted model configuration in tests to influence type
interpretation.
- **Documentation**
- Improved clarity of comments and logging statements for better
understanding.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>1 parent 8e27d2f commit cdad312
2 files changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
155 | 158 | | |
156 | 159 | | |
157 | 160 | | |
| |||
0 commit comments