Skip to content

Commit 5215c53

Browse files
wanghan-iapcmHan Wang
andauthored
test(infer): swap se_e2_a fixture to deeppot_sea (type_one_side=True) (#5445)
## Summary - Repoint the `se_e2_a` test fixture in `source/tests/infer/deeppot-testcase.yaml` from the legacy `deeppot.yaml` (`type_one_side=False`) at `deeppot_sea.yaml` (`type_one_side=True`). - Regenerate reference values for the 3 result blocks (PBC, NoPBC, big-box) plus descriptor and fit_ll for block 1 using the same `convert_backend → tmp.pth → DeepPot.eval(...)` pipeline that `TestDeepPot` uses at runtime. - Drop the now-unneeded `if key in ("se_e2_a", "se_e2_r") and extension in (".pte", ".pt2"): SKIP` clause; only `se_e2_r` still skips for pt_expt extensions. - Remove the obsolete `source/tests/infer/deeppot.yaml` (no remaining references; `deeppot.pbtxt`, used directly by C++ tests, is unrelated and untouched). ## Why The legacy `deeppot.yaml` used `type_one_side=False`, which hits a data-dependent symbolic-int guard in `make_fx` when pt_expt tries to export the `ndim=2` NetworkCollection. As a result, `TestDeepPot_se_e2_a_.pte` and `TestDeepPot_se_e2_a_.pt2` skipped entirely, leaving the plain `se_e2_a → .pte / .pt2` slice of `dp convert-backend` uncovered. Only `fparam_aparam_.pte/.pt2` exercised the pt_expt export path, and that case carries extra fparam/aparam complexity. After the swap, all four extensions (`.pb`, `.pth`, `.pte`, `.pt2`) run for `se_e2_a`. `dp convert-backend deeppot_sea.yaml → .{pb,pth,pte,pt2}` is now exercised end-to-end with energy / force / virial assertions, plus descriptor (.pth, .pb) and fit_ll (.pth) pinning. ## Test plan - [x] `python -m pytest source/tests/infer/test_models.py` → `71 passed, 51 skipped` (was `55 passed, 67 skipped`). - [x] `python -m pytest -v -k TestDeepPot_se_e2_a_` → all 40 cases either PASS or SKIP for documented reasons (test_descriptor / test_fitting_last_layer skip on .pte/.pt2 per the existing global skip in `test_models.py`). - [x] `test_model_script_def` passes on all 4 extensions, confirming the case yaml's `model_def_script` matches what's serialized in `deeppot_sea.yaml` (and so survives `convert_backend` round-trips). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Updated a test fixture to use a variant-specific model definition and simplified model configuration. * Regenerated numeric result data for energies, forces, virials, descriptors, and fit outputs. * Added per-key precision/tolerance control and applied it across comparisons. * Adjusted test skip/exclusion behavior for certain model export formats. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/deepmodeling/deepmd-kit/pull/5445) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Han Wang <wang_han@iapcm.ac.cn>
1 parent 9847afb commit 5215c53

4 files changed

Lines changed: 503 additions & 4246 deletions

File tree

0 commit comments

Comments
 (0)