Skip to content

Commit

Permalink
Test non-integer indices
Browse files Browse the repository at this point in the history
  • Loading branch information
Uri Granta committed Aug 7, 2024
1 parent b13c147 commit 63b62b1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/unit/test_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -1745,6 +1745,12 @@ def test_categorical_search_space__to_tags(
npt.assert_array_equal(tags, expected_tags)


def test_categorical_search_space__to_tags_raises_for_non_integers() -> None:
search_space = CategoricalSearchSpace(["A", "B", "C"], dtype=tf.float32)
with pytest.raises(ValueError):
search_space.to_tags(tf.constant([[1.0], [1.2]]))


@pytest.mark.parametrize(
"search_space, query_points, encoded_points",
[
Expand Down

0 comments on commit 63b62b1

Please sign in to comment.