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

[bug fix] SC Matrix Checking Logic #704

Merged
merged 1 commit into from
Feb 7, 2024
Merged

Conversation

jmmshn
Copy link
Contributor

@jmmshn jmmshn commented Feb 7, 2024

Summary

Make the check for the shape of the reference supercell matrix more explicit.

Under the old code, it is possible to have two supercells of the exact same shape.

The exact example is given below

ipdb> print(uc_structure.lattice)
5.090004 -0.000001 -0.000007
2.545003 -4.408073 -0.000007
2.545009 -1.469362 -4.595759

# sc_mats are different (old code will compare these and raise an error)
ipdb> print(sc_mat_ref)
[[2, 0, 0], [2, -3, 0], [1, 1, -3]]
ipdb> print(sc_mat_prv)
[[-2  2  0]
 [-2 -1  0]
 [-1 -1  3]]

# actual structures are the same (new code will continue excution)
ipdb> print(sc_ref.lattice.abc, sc_ref.lattice.angles)
(10.180005983446268, 13.466886920683072, 13.787261249420052) (90.0001838526074, 89.99999983000444, 79.10660876819587)
ipdb> print(sc_prv.lattice.abc, sc_prv.lattice.angles)
(10.180005983446268, 13.466886920683072, 13.787261249420052) (90.0001838526074, 89.99999983000444, 79.10660876819587)

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (23b3c4b) 76.32% compared to head (317167b) 76.17%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #704      +/-   ##
==========================================
- Coverage   76.32%   76.17%   -0.16%     
==========================================
  Files          87       87              
  Lines        7164     7164              
  Branches     1057     1057              
==========================================
- Hits         5468     5457      -11     
- Misses       1373     1385      +12     
+ Partials      323      322       -1     
Files Coverage Δ
src/atomate2/common/jobs/defect.py 81.67% <0.00%> (ø)

... and 1 file with indirect coverage changes

@utf utf merged commit e5ab301 into materialsproject:main Feb 7, 2024
6 of 7 checks passed
@utf
Copy link
Member

utf commented Feb 7, 2024

Thanks!

@utf utf added the fix Bug fix PR label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants