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

use np.testing.assert_almost_equal for array comparing #1059

Merged
merged 9 commits into from
Aug 31, 2021

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Aug 29, 2021

See my comment below.

@codecov-commenter
Copy link

codecov-commenter commented Aug 29, 2021

Codecov Report

Merging #1059 (6948ba9) into devel (8dbc211) will decrease coverage by 10.88%.
The diff coverage is n/a.

❗ Current head 6948ba9 differs from pull request most recent head 5577461. Consider uploading reports for the commit 5577461 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##            devel    #1059       +/-   ##
===========================================
- Coverage   75.16%   64.28%   -10.89%     
===========================================
  Files          87        5       -82     
  Lines        6959       14     -6945     
===========================================
- Hits         5231        9     -5222     
+ Misses       1728        5     -1723     
Impacted Files Coverage Δ
source/op/_prod_virial_se_r_grad.py
deepmd/utils/weight_avg.py
deepmd/entrypoints/__init__.py
deepmd/infer/deep_polar.py
deepmd/descriptor/se_a.py
deepmd/cluster/__init__.py
source/op/_prod_virial_grad.py
deepmd/calculator.py
source/op/_soft_min_virial_grad.py
deepmd/descriptor/se_r.py
... and 72 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8dbc211...5577461. Read the comment docs.

dp_random.seed(0)
data2 = DeepmdDataSystem(['system_0', 'system_1'],
5,
10,
1.0)
data2.add('force', 3, atomic = True, must = True)
data2.add('energy', 1, must = True)
Copy link
Member Author

@njzjz njzjz Aug 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original data1 and data2 are not equal - but the original compare method didn't find it...
I'm not sure what's the purpose of this test case?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a bug in the UT...

@njzjz njzjz marked this pull request as ready for review August 29, 2021 14:22
@njzjz njzjz requested a review from amcadmus August 29, 2021 14:22
@amcadmus amcadmus merged commit 8cf52fd into deepmodeling:devel Aug 31, 2021
@njzjz njzjz deleted the np.testing.assert_almost_equal branch August 31, 2021 02:21
njzjz pushed a commit to njzjz/deepmd-kit that referenced this pull request Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants