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

Handle symmetry ops that produce fractional HKLs in apply_to_hkl() #171

Merged
merged 2 commits into from
Aug 1, 2022

Conversation

JBGreisman
Copy link
Member

This PR fixes #134 by adding some additional logic to rs.utils.apply_to_hkl(). Before, the use of np.floor_divide() would return the closest integer HKL, regardless of whether the true symmetry operation yielded a fractional result. Now, symmetry operations that produce non-integer output on the given Miller indices raise a RuntimeError

@JBGreisman JBGreisman added the bug Something isn't working label Aug 1, 2022
@JBGreisman JBGreisman requested a review from kmdalton August 1, 2022 18:21
@codecov-commenter
Copy link

codecov-commenter commented Aug 1, 2022

Codecov Report

Merging #171 (4f89898) into main (aeac62c) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #171   +/-   ##
=======================================
  Coverage   98.30%   98.31%           
=======================================
  Files          44       44           
  Lines        1713     1718    +5     
=======================================
+ Hits         1684     1689    +5     
  Misses         29       29           
Flag Coverage Δ
unittests 98.31% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
reciprocalspaceship/utils/symop.py 100.00% <100.00%> (ø)

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 aeac62c...4f89898. Read the comment docs.

Copy link
Member

@kmdalton kmdalton left a comment

Choose a reason for hiding this comment

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

I can't find any bugs.

@JBGreisman JBGreisman merged commit d0d2880 into main Aug 1, 2022
@JBGreisman JBGreisman deleted the fractional_woes branch August 1, 2022 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding a warning to apply_symop()
3 participants