Skip to content

Commit

Permalink
TST: test case of weights and conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
mj-will committed Apr 8, 2024
1 parent 2ddf665 commit c8e3361
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_flowmodel/test_flowmodel_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,22 @@ def test_prep_data_non_finite_weights(model, w):
FlowModel.prep_data(model, np.random.rand(100), 0.1, 50, weights=w)


def test_prep_data_weights_and_conditional(model):
"""Assert an error is raised if weights and conditional are specified"""
model.initialised = True
with pytest.raises(
RuntimeError, match=r"weights and conditional inputs not supported"
):
FlowModel.prep_data(
model,
np.random.rand(100),
0.1,
50,
weights=np.random.rand(100),
conditional=np.random.rand(100),
)


@pytest.mark.parametrize("dataloader", [False, True])
def test_training(flow_model, data_dim, dataloader):
"""Test class until training"""
Expand Down

0 comments on commit c8e3361

Please sign in to comment.