Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Kevin Welsh <[email protected]>
  • Loading branch information
ZackAttack614 and kpwelsh authored Jan 30, 2025
1 parent 1b6f4b6 commit ceed057
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 2 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ def get_pybind11_include_path():

def get_cpp_extensions():
cpp_transform_pkgdir = Path('hexrd') / 'transforms/cpp_sublibrary'
src_files = [
str(cpp_transform_pkgdir / 'src/transforms.cpp'),
str(cpp_transform_pkgdir / 'src/inverse_distortion.cpp'),
]

extra_compile_args = [
'-O3',
Expand All @@ -139,15 +135,15 @@ def get_cpp_extensions():

transforms_ext = Extension(
name='hexrd.extensions.transforms',
sources=[src_files[0]],
sources=[cpp_transform_pkgdir / 'src/transforms.cpp'],
extra_compile_args=extra_compile_args,
include_dirs=include_dirs,
language='c++',
)

inverse_distortion_ext = Extension(
name='hexrd.extensions.inverse_distortion',
sources=[src_files[1]],
sources=[cpp_transform_pkgdir / 'src/inverse_distortion.cpp'],
extra_compile_args=extra_compile_args,
include_dirs=include_dirs,
language='c++',
Expand Down
3 changes: 2 additions & 1 deletion tests/transforms/test_make_binary_rmat.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def test_make_binary_rmat():

# Two binary rmats should be the identity
assert np.allclose(rmat @ rmat, np.eye(3))

assert np.allclose(rmat.T @ rmat, np.eye(3)), "It is orthogonal"
assert np.all((np.abs(rmat) - 1 < 1e-10) | (np.abs(rmat) < 1e-10)), "It is binary"
rmat_expected = rotMatOfQuat(
quatOfAngleAxis(np.pi, np.c_[axis])
)
Expand Down

0 comments on commit ceed057

Please sign in to comment.