Skip to content

Commit

Permalink
ok i may have figured it out... NOOO
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo-consoli committed Nov 22, 2023
1 parent f992a38 commit 4492aa4
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions code-experiments/build/python/test/test_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,14 @@ def test_bbob():
for instance in [0, 1, 10, 100, 1000]:
fn = BenchmarkFunction("bbob", fid, dimension, instance)
assert str(fn) == f"bbob_f{fid:03d}_i{instance:02d}_d{dimension:02d}"
assert fn(x0) >= fn.best_value()


def test_list():
fn = BenchmarkFunction("bbob", 1, 4, 1)
assert fn([1, 2, 3, 4]) >= fn([1.0, 2.0, 3.0, 4.0])


def test_multiple_parameters():
for n in [1, 2, 10, 100, 200]:
fn = BenchmarkFunction("bbob", 1, 4, 1)
X = np.random.uniform(-5, 5, size=(n, 4))
y = fn(X)
assert len(y) == n
assert np.all(y >= fn.best_value())

0 comments on commit 4492aa4

Please sign in to comment.