Skip to content

Commit

Permalink
Fix some pytest warnings (#409)
Browse files Browse the repository at this point in the history
Most significant is the bad `\e` escape sequence which I believe crashes on python 3.10.

The change from `general_exp(b)` to `b.exp()` cleans up some deprecation warnings.
  • Loading branch information
eric-wieser committed Jul 20, 2021
1 parent a5b1c3f commit 449d938
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion clifford/taylor_expansions.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

@_numba_utils.njit
def exp(x, max_order=15):
"""
r"""
This implements the series expansion of :math:`\exp x` where :math:`x` is a multivector
The parameter `max_order` is the maximum order of the taylor series to use
"""
Expand Down
15 changes: 7 additions & 8 deletions clifford/test/test_g3c_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

from clifford import Cl
from clifford.g3c import *
from clifford import general_exp
from clifford.tools.g3c import *
from clifford.tools.g3c.rotor_parameterisation import ga_log, ga_exp, general_logarithm, \
interpolate_rotors
Expand Down Expand Up @@ -107,7 +106,7 @@ def test_general_logarithm_translation(self, rng): # noqa: F811
for i in range(50):
t = random_euc_mv(rng=rng)
biv = ninf * t / 2
R = general_exp(biv).normal()
R = biv.exp().normal()
biv_2 = general_logarithm(R)
assert_allclose(biv.value, biv_2.value)

Expand All @@ -116,7 +115,7 @@ def test_general_logarithm_scaling(self, rng): # noqa: F811
for i in range(50):
scale = 0.5 + rng.random()
biv = -np.log(scale) * e45 / 2
R = general_exp(biv).normal()
R = biv.exp().normal()
biv_2 = general_logarithm(R)
assert_allclose(biv.value, biv_2.value)

Expand All @@ -142,10 +141,10 @@ def test_general_logarithm_TR(self, rng): # noqa: F811
# T = generate_translation_rotor(e3 + 7 * e2 - e1).normal()
# V = (T*R).normal()
biv_true = random_bivector(rng=rng)
V = general_exp(biv_true).normal()
V = biv_true.exp().normal()
biv = general_logarithm(V)

V_rebuilt = (general_exp(biv)).normal()
V_rebuilt = biv.exp().normal()

C1 = random_point_pair(rng=rng)
C2 = (V * C1 * ~V).normal()
Expand All @@ -160,7 +159,7 @@ def test_general_logarithm_TS(self, rng): # noqa: F811
T = generate_translation_rotor(t)
V = (T * S).normal()
biv = general_logarithm(V)
V_rebuilt = (general_exp(biv)).normal()
V_rebuilt = biv.exp().normal()

C1 = random_point_pair(rng=rng)
C2 = (V * C1 * ~V).normal()
Expand All @@ -175,7 +174,7 @@ def test_general_logarithm_TRS(self, rng): # noqa: F811
T = generate_translation_rotor(e3 + 7 * e2 - e1)
V = (T * R * S).normal()
biv = general_logarithm(V)
V_rebuilt = general_exp(biv).normal()
V_rebuilt = biv.exp().normal()
biv2 = general_logarithm(V)

C1 = random_point_pair(rng=rng)
Expand All @@ -192,7 +191,7 @@ def test_general_logarithm_conformal(self, obj_gen, rng): # noqa: F811
Y = obj_gen(rng=rng)
R = rotor_between_objects(X, Y)
biv = general_logarithm(R)
R_recon = general_exp(biv).normal()
R_recon = biv.exp().normal()
assert_allclose(R.value, R_recon.value)


Expand Down
2 changes: 1 addition & 1 deletion clifford/test/test_multivector_inverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_hitzer_inverse(self, p, q, r, rng): # noqa: F811

@pytest.mark.parametrize('r', range(2))
@pytest.mark.parametrize('p, q', [
pytest.param(p, total_dims - p, marks=[pytest.mark.slow, too_slow_without_jit] if total_dims >= 6 else [])
pytest.param(p, total_dims - p, marks=[pytest.mark.veryslow, too_slow_without_jit] if total_dims >= 6 else [])
for total_dims in [1, 2, 3, 4, 5, 6, 7, 8]
for p in range(total_dims + 1)
])
Expand Down

0 comments on commit 449d938

Please sign in to comment.