Skip to content

Commit 6d9a527

Browse files
committed
Expediate removal of 'convention' in some Quaternion methods to 0.13
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
1 parent e0e051f commit 6d9a527

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Added
1414

1515
Changed
1616
-------
17+
- The ``convention`` parameter in ``from_euler()`` and ``to_euler()`` will be removed in
18+
the next minor release, 0.13, instead of release 1.0 as previously stated.
1719

1820
Deprecated
1921
----------

orix/quaternion/quaternion.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,9 @@ def from_axes_angles(
297297
q = cls.from_neo_euler(axangle).unit
298298
return q
299299

300-
# TODO: Remove decorator, **kwargs, and use of "convention" in 1.0
300+
# TODO: Remove decorator, **kwargs, and use of "convention" in 0.13
301301
@classmethod
302-
@deprecated_argument("convention", "0.9", "1.0", "direction")
302+
@deprecated_argument("convention", "0.9", "0.13", "direction")
303303
def from_euler(
304304
cls,
305305
euler: Union[np.ndarray, tuple, list],
@@ -772,8 +772,8 @@ def outer(
772772
"with `other` of type `Quaternion` or `Vector3d`"
773773
)
774774

775-
# TODO: Remove decorator and **kwargs in 1.0
776-
@deprecated_argument("convention", since="0.9", removal="1.0")
775+
# TODO: Remove decorator and **kwargs in 0.13
776+
@deprecated_argument("convention", since="0.9", removal="0.13")
777777
def to_euler(self, degrees: bool = False, **kwargs) -> np.ndarray:
778778
r"""Return the normalized quaternions as Euler angles in the
779779
Bunge convention :cite:`rowenhorst2015consistent`.

orix/quaternion/rotation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def from_axes_angles(
224224
"""
225225
return super().from_axes_angles(axes, angles, degrees)
226226

227-
# TODO: Remove **kwargs in 1.0.
227+
# TODO: Remove **kwargs in 0.13
228228
# Deprication decorator is implemented in Quaternion
229229
@classmethod
230230
def from_euler(
@@ -719,7 +719,7 @@ def to_matrix(self) -> np.ndarray:
719719
"""
720720
return super().to_matrix()
721721

722-
# TODO: Remove **kwargs in 1.0
722+
# TODO: Remove **kwargs in 0.13
723723
def to_euler(self, degrees: bool = False, **kwargs) -> np.ndarray:
724724
r"""Return the rotations as Euler angles in the Bunge convention
725725
:cite:`rowenhorst2015consistent`.

orix/tests/quaternion/test_orientation.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ def test_from_scipy_rotation(self):
561561
with pytest.raises(TypeError, match="Value must be an instance of"):
562562
_ = Orientation.from_scipy_rotation(r_scipy, (Oh, Oh))
563563

564-
# TODO: Remove in 1.0
564+
# TODO: Remove in 0.13
565565
def test_from_euler_warns(self):
566566
"""Orientation.from_euler() warns only once when "convention"
567567
argument is passed.
@@ -573,7 +573,7 @@ def test_from_euler_warns(self):
573573
_ = Orientation.from_euler(euler)
574574

575575
msg = (
576-
r"Argument `convention` is deprecated and will be removed in version 1.0. "
576+
r"Argument `convention` is deprecated and will be removed in version 0.13. "
577577
r"To avoid this warning, please do not use `convention`. "
578578
r"Use `direction` instead. See the documentation of `from_euler\(\)` for "
579579
"more details."
@@ -582,7 +582,7 @@ def test_from_euler_warns(self):
582582
_ = Orientation.from_euler(euler, convention="whatever")
583583
assert len(record2) == 1
584584

585-
# TODO: Remove in 1.0
585+
# TODO: Remove in 0.13
586586
def test_from_euler_convention_mtex(self):
587587
"""Passing convention="mtex" to Orientation.from_euler() works
588588
but warns once.
@@ -593,7 +593,7 @@ def test_from_euler_convention_mtex(self):
593593
ori2 = Orientation.from_euler(euler, convention="mtex")
594594
assert np.allclose(ori1.data, ori2.data)
595595

596-
# TODO: Remove in 1.0
596+
# TODO: Remove in 0.13
597597
def test_to_euler_convention_warns(self):
598598
"""Orientation.to_euler() warns only once when "convention"
599599
argument is passed.
@@ -605,7 +605,7 @@ def test_to_euler_convention_warns(self):
605605
ori2 = ori1.to_euler()
606606

607607
msg = (
608-
r"Argument `convention` is deprecated and will be removed in version 1.0. "
608+
r"Argument `convention` is deprecated and will be removed in version 0.13. "
609609
r"To avoid this warning, please do not use `convention`. "
610610
r"See the documentation of `to_euler\(\)` for more details."
611611
)

orix/tests/quaternion/test_quaternion.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def test_passing_degrees_warns(self):
355355
q = Quaternion.from_euler([90, 0, 0])
356356
assert np.allclose(q.data, [0.5253, 0, 0, -0.8509], atol=1e-4)
357357

358-
# TODO: Remove in 1.0
358+
# TODO: Remove in 0.13
359359
def test_from_euler_warns(self, eu):
360360
"""Quaternion.from_euler() warns only when "convention" argument
361361
is passed.
@@ -366,15 +366,15 @@ def test_from_euler_warns(self, eu):
366366
_ = Quaternion.from_euler(eu)
367367

368368
msg = (
369-
r"Argument `convention` is deprecated and will be removed in version 1.0. "
369+
r"Argument `convention` is deprecated and will be removed in version 0.13. "
370370
r"To avoid this warning, please do not use `convention`. "
371371
r"Use `direction` instead. See the documentation of `from_euler\(\)` for "
372372
"more details."
373373
)
374374
with pytest.warns(np.VisibleDeprecationWarning, match=msg):
375375
_ = Quaternion.from_euler(eu, convention="whatever")
376376

377-
# TODO: Remove in 1.0
377+
# TODO: Remove in 0.13
378378
def test_from_euler_convention_mtex(self, eu):
379379
"""Passing convention="mtex" to Quaternion.from_euler() works but
380380
warns.
@@ -384,7 +384,7 @@ def test_from_euler_convention_mtex(self, eu):
384384
q2 = Quaternion.from_euler(eu, convention="mtex")
385385
assert np.allclose(q1.data, q2.data)
386386

387-
# TODO: Remove in 1.0
387+
# TODO: Remove in 0.13
388388
def test_to_euler_convention_warns(self, eu):
389389
"""Quaternion.to_euler() warns only when "convention" argument is
390390
passed.
@@ -397,7 +397,7 @@ def test_to_euler_convention_warns(self, eu):
397397
q2 = q1.to_euler()
398398

399399
msg = (
400-
r"Argument `convention` is deprecated and will be removed in version 1.0. "
400+
r"Argument `convention` is deprecated and will be removed in version 0.13. "
401401
r"To avoid this warning, please do not use `convention`. "
402402
r"See the documentation of `to_euler\(\)` for more details."
403403
)

0 commit comments

Comments
 (0)