Skip to content

Commit

Permalink
add benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
axsk committed Jun 10, 2020
1 parent 3822a2e commit 80227f5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
21 changes: 21 additions & 0 deletions tests/test_pcca.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,24 @@ def test_krylovschur(n=30, m=5, N=100):
K = pcca.krylovschur(A, m)
R = np.linalg.matrix_rank(np.concatenate([S, K], axis=1), tol=1e-6)
assert R == m


def test_bench_scipyschur(benchmark, n=500, m=6):
T = utils.randompropagator(n)
massmatrix = np.diag(np.ones(n))
solver = pcca.ScipySchur()
benchmark(solver.solve, T, m, massmatrix)


def test_bench_scipyqz(benchmark, n=500, m=6):
T = utils.randompropagator(n)
solver = pcca.ScipySchur()
benchmark(solver.solve, T, m)


def test_bench_krylovschur(benchmark, n=500, m=6):
if not pcca.HAS_SLEPC:
return
T = utils.randompropagator(n)
solver = pcca.KrylovSchur(onseperation="continue")
benchmark(solver.solve, T, m)
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ envlist = py37, py27
deps =
pytest
pytest-cov
pytest-benchmark
commands =
pytest --cov=cmdtools --cov-report term-missing
pytest --cov=cmdtools --cov-report term-missing --benchmark-skip

0 comments on commit 80227f5

Please sign in to comment.