Skip to content

Commit

Permalink
Added tests got bad arguments to SBR optimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkelbue committed Feb 6, 2024
1 parent 1ec2523 commit 73c2fd5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/test_optimizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,26 @@ def test_sindypi_fit(params):
model.fit(x_train, t=t)
assert np.shape(opt.coef_) == (10, 10)

@pytest.mark.parametrize(
"params",
[
dict(sparsity_coef_tau0=0),
dict(sparsity_coef_tau0=-1),
dict(slab_shape_nu=0),
dict(slab_shape_nu=-1),
dict(slab_shape_s=0),
dict(slab_shape_s=-1),
dict(noise_hyper_lambda=0),
dict(noise_hyper_lambda=-1),
dict(num_warmup=0.5),
dict(num_warmup=-1),
dict(num_samples=0.5),
dict(num_samples=-1),
],
)
def test_sbr_bad_parameters(params):
with pytest.raises(ValueError):
SBR(**params)

@pytest.mark.parametrize(
"params",
Expand Down

0 comments on commit 73c2fd5

Please sign in to comment.