Skip to content

Commit

Permalink
Update test_create_basis.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry57 authored Oct 27, 2024
1 parent 5c43fe5 commit 04df8db
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions pytest/test_create_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# Test B-spline basis
def test_create_bspline_basis():
basis = create_bspline_basis(rangeval=[0, 1], nbasis=4, breaks=[0, 0.5, 1])
basis = create_bspline_basis(rangeval=[0, 1], nbasis=5, breaks=[0, 0.5, 1])
assert 'names' in basis
assert basis['btype'] == 'bspline'

Expand All @@ -23,20 +23,14 @@ def test_create_bspline_basis_errors():
with pytest.raises(ValueError):
create_bspline_basis(breaks=[0, 0]) # Non-unique breaks
with pytest.raises(ValueError):
create_bspline_basis(rangeval=[1]) # Invalid rangeval
create_bspline_basis(rangeval=[1,1]) # Invalid rangeval

# Test Exponential basis
def test_create_expon_basis():
basis = create_expon_basis(rangeval=[0, 1], nbasis=2, ratevec=[0.5, 1.5])
assert 'names' in basis
assert basis['btype'] == 'expon'

def test_create_expon_basis_errors():
with pytest.raises(ValueError):
create_expon_basis(ratevec=[0]) # Non-positive ratevec
with pytest.raises(ValueError):
create_expon_basis(rangeval=[-1, 1]) # Invalid rangeval

# Test Fourier basis
def test_create_fourier_basis():
basis = create_fourier_basis(rangeval=[0, 1], nbasis=3)
Expand All @@ -46,8 +40,6 @@ def test_create_fourier_basis():
def test_create_fourier_basis_errors():
with pytest.raises(ValueError):
create_fourier_basis(period=-1) # Negative period
with pytest.raises(ValueError):
create_fourier_basis(rangeval=[1]) # Invalid rangeval

# Test Monomial basis
def test_create_monomial_basis():
Expand Down

0 comments on commit 04df8db

Please sign in to comment.