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

Origin choice for selected space groups #711

Merged
merged 9 commits into from
Aug 20, 2024
Merged

Origin choice for selected space groups #711

merged 9 commits into from
Aug 20, 2024

Conversation

saransh13
Copy link
Member

Issue #559 pointed out that the density of diamond was 2x the theoretical density. It was traced back to the default choice of the origin. hexrd had origin choice 1 by default, while most CIF files available online assume origin choice 2.

The following changes have been made in this PR:

  • All 24 space groups with two origin choices have been explicitly listed
  • If user does not specify origin choice, then origin choice 2 is assumed by default for these 24 space groups.
  • During h5 file I/O, the origin choice can be explicitly passed as an argument sgsetting. This will override the value from the file.

Fixes #559 on the hexrd side. The GUI still needs to implement an input for the origin choice.

@pep8speaks
Copy link

pep8speaks commented Aug 20, 2024

Hello @saransh13! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 99:1: E303 too many blank lines (3)
Line 108:1: E303 too many blank lines (3)
Line 118:1: E303 too many blank lines (3)
Line 134:52: W291 trailing whitespace
Line 135:53: W291 trailing whitespace
Line 136:55: W291 trailing whitespace

Comment last updated at 2024-08-20 20:43:25 UTC

@saransh13 saransh13 marked this pull request as draft August 20, 2024 18:07
@saransh13 saransh13 marked this pull request as ready for review August 20, 2024 18:53
Comment on lines +118 to +130
t = 'a' + t # get the translation without any rotation
sym = np.squeeze(SYM_fillgen(t, sgn=-1))
sym2 = np.squeeze(SYM_fillgen(t))
for i in range(1, genmat.shape[0]):
generator = np.dot(sym2, np.dot(
np.squeeze(genmat[i, :, :]),
sym))
frac = np.modf(generator[0:3, 3])[0]
frac[frac < 0.] += 1.
frac[np.abs(frac) < 1E-5] = 0.0
frac[np.abs(frac-1.0) < 1E-5] = 0.0
generator[0:3, 3] = frac
genmat[i, :, :] = generator
Copy link
Collaborator

Choose a reason for hiding this comment

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

@saransh13 This is the only section with functional code changes, correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

This only affects materials with a different origin choice. What material is used in the failing test?

Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 53.00000% with 47 lines in your changes missing coverage. Please review.

Project coverage is 33.50%. Comparing base (433a0d5) to head (3601b9f).
Report is 11 commits behind head on master.

Files Patch % Lines
hexrd/material/symbols.py 21.62% 29 Missing ⚠️
hexrd/material/symmetry.py 66.66% 15 Missing ⚠️
hexrd/material/mksupport.py 25.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #711   +/-   ##
=======================================
  Coverage   33.49%   33.50%           
=======================================
  Files         129      129           
  Lines       21237    21253   +16     
=======================================
+ Hits         7113     7120    +7     
- Misses      14124    14133    +9     

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

@saransh13 saransh13 merged commit 5f1f4c5 into master Aug 20, 2024
8 checks passed
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.

Density of diamond cubic
3 participants