Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: better structure for the dpmodel uts #3232

Merged

Conversation

wanghan-iapcm
Copy link
Collaborator

@wanghan-iapcm wanghan-iapcm commented Feb 5, 2024

  • mv all dpmodel related UTs to a separate directory
  • split the large test_model_format_utils.py as tests for different modules.

source/tests/common/dpmodel/test_dp_model.py Fixed Show fixed Hide fixed
self.rcut_smth = 0.4
self.rcut = 2.1

nf, nloc, nnei = self.expected_nlist.shape

Check notice

Code scanning / CodeQL

Unused local variable Note test

Variable nloc is not used.
self.rcut_smth = 0.4
self.rcut = 2.1

nf, nloc, nnei = self.expected_nlist.shape

Check notice

Code scanning / CodeQL

Unused local variable Note test

Variable nnei is not used.
source/tests/common/dpmodel/test_network.py Fixed Show fixed Hide fixed
source/tests/common/dpmodel/test_network.py Fixed Show fixed Hide fixed
Copy link

codecov bot commented Feb 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f5bb131) 0.00% compared to head (9da113e) 20.76%.

Additional details and impacted files
@@            Coverage Diff             @@
##           devel    #3232       +/-   ##
==========================================
+ Coverage       0   20.76%   +20.76%     
==========================================
  Files          0      363      +363     
  Lines          0    32515    +32515     
  Branches       0     1595     +1595     
==========================================
+ Hits           0     6752     +6752     
- Misses         0    25064    +25064     
- Partials       0      699      +699     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wanghan-iapcm wanghan-iapcm changed the title enh: better structure for the dpmodel uts test: better structure for the dpmodel uts Feb 5, 2024
if nfp > 0:
ifp = rng.normal(size=(self.nf, nfp - 1))
with self.assertRaises(ValueError) as context:
ret0 = ifn0(dd[0], atype, fparam=ifp, aparam=iap)

Check warning

Code scanning / CodeQL

Variable defined multiple times Warning test

This assignment to 'ret0' is unnecessary as it is
redefined
before this value is used.
@wanghan-iapcm wanghan-iapcm merged commit 18c43f6 into deepmodeling:devel Feb 6, 2024
46 checks passed
@wanghan-iapcm wanghan-iapcm deleted the dpmodel-ut-structure branch February 6, 2024 01:21
@njzjz njzjz mentioned this pull request Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants