Skip to content

Commit

Permalink
Experiment: Improve test coverage
Browse files Browse the repository at this point in the history
In test_algebra_initialisation.py, remove 'too_slow_without_jit' and
'veryslow' marks, except for 'conformalize(Cl(3))' test. These test are
not that slow, esp. after numpy vectorized mv_mult() implementation.

This adds coverage over _get_mult_function.mv_mult(), as such is only
registered when function is not JIT-ed.
  • Loading branch information
trundev committed Dec 13, 2024
1 parent d24805d commit 819dc8c
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions clifford/test/test_algebra_initialisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,14 @@
import pytest

from clifford import Cl, conformalize, _powerset
from clifford._numba_utils import DISABLE_JIT

from . import rng # noqa: F401

too_slow_without_jit = pytest.mark.skipif(
DISABLE_JIT, reason="test is too slow without JIT"
)


class TestInitialisation:

@pytest.mark.parametrize("n", [
x
for x in range(2, 7)
] + [
pytest.param(x, marks=too_slow_without_jit)
for x in range(7, 9)
x for x in range(2, 9)
])
def test_speed(self, n, benchmark):
def generate_algebra():
Expand All @@ -35,11 +26,10 @@ def generate_algebra():
layout.inv_func
benchmark(generate_algebra)

@too_slow_without_jit
@pytest.mark.veryslow
@pytest.mark.parametrize(
'algebra',
[Cl(i) for i in [4]] + [conformalize(Cl(3)[0])],
[Cl(i) for i in [4]]
+ [pytest.param(conformalize(Cl(3)[0]), marks=pytest.mark.veryslow)],
ids=['Cl(4)', 'conformalize(Cl(3))']
)
def test_sparse_multiply(self, algebra, rng): # noqa: F811
Expand Down

0 comments on commit 819dc8c

Please sign in to comment.