rs-station / reciprocalspaceship

Tools for exploring reciprocal space
https://rs-station.github.io/reciprocalspaceship/
MIT License
28 stars 11 forks source link

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

Closed JBGreisman closed 1 year ago

JBGreisman commented 1 year ago

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

codecov-commenter commented 1 year ago

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%) :arrow_up:

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.