Skip to content

Commit dc0b51c

Browse files
authored
bump version (#96)
1 parent fc49cdb commit dc0b51c

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

pylinalg/quaternion.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def quat_from_axis_angle(axis, angle, /, *, out=None, dtype=None):
252252

253253
# result should be independent of the length of the given axis
254254
lengths_shape = axis.shape[:-1] + (1,)
255-
axis /= np.linalg.norm(axis, axis=-1).reshape(lengths_shape)
255+
axis = axis / np.linalg.norm(axis, axis=-1).reshape(lengths_shape)
256256

257257
out[..., :3] = axis * np.sin(angle / 2).reshape(lengths_shape)
258258
out[..., 3] = np.cos(angle / 2)

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[project]
44
name = "pylinalg"
5-
version = "0.6.0"
5+
version = "0.6.1"
66
description = "Linear algebra utilities for Python"
77
readme = "README.md"
88
license = { file = "LICENSE" }

tests/test_quaternion.py

+8
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,11 @@ def test_quat_from_euler(angles, order):
190190

191191
expected = la.mat_from_euler(angles, order=order)
192192
assert np.allclose(actual, expected)
193+
194+
195+
def test_quat_from_axis_angle_input_mutation():
196+
"""(Regression) test that the input arguments are not mutated in-place."""
197+
axis = np.array((0.0, 2.0, 0.0))
198+
backup = axis.copy()
199+
la.quat_from_axis_angle(axis, np.pi / 2)
200+
npt.assert_array_equal(axis, backup)

0 commit comments

Comments
 (0)