-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0af53f3
commit b73dacf
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |