Skip to content

Commit

Permalink
+ jacobi, q poly tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brandondube committed Sep 3, 2019
1 parent 0af53f3 commit b73dacf
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_jacobi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""Jacobi submodule tests."""

import numpy as np

import pytest

from scipy.special import jacobi as sps_jac

from prysm import jacobi as pjac

@pytest.mark.parametrize('n', [0, 1, 2, 3, 4])
@pytest.mark.parametrize('alpha, beta', [
(0,0),
(1,1),
(-0.75,0),
(1,-0.75)])
def test_jacobi_1_4_match_scipy(n, alpha, beta):
x = np.linspace(-1, 1, 32)
prysm_ = pjac.jacobi(n=n, alpha=alpha, beta=beta, x=x)
scipy_ = sps_jac(n=n, alpha=alpha, beta=beta)(x)
assert np.allclose(prysm_, scipy_)
19 changes: 19 additions & 0 deletions tests/test_qpoly.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""Q polynomial tests."""

import pytest

from prysm import qpoly


@pytest.mark.parametrize('n', [0, 1, 2, 3, 4, 5, 6])
def test_qbfs_functions(n):
args = {f'A{n}': 1}
qbfs_sag = qpoly.QBFSSag(**args)
assert qbfs_sag


@pytest.mark.parametrize('n', [0, 1, 2, 3, 4, 5, 6])
def test_qcon_functions(n):
args = {f'A{n}': 1}
qcon_sag = qpoly.QCONSag(**args)
assert qcon_sag

0 comments on commit b73dacf

Please sign in to comment.