Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions bluepyopt/tests/test_deapext/test_optimisationsCMA.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_optimisationsCMA_normspace():
optimisation.to_space)]

for a, b in zip(x, y):
assert abs(a - b) < 1e-5
assert b == pytest.approx(a, abs=1e-5)


@pytest.mark.unit
Expand All @@ -34,9 +34,10 @@ def test_optimisationsCMA_SO_run():
optimisation = optimiser(evaluator=evaluator, centroids=[x])
pop, hof, log, hist = optimisation.run(max_ngen=2)

assert abs(log.select("avg")[-1] - 53.3333) < 1e-4
assert abs(log.select("std")[-1] - 83.7987) < 1e-4
assert pop[0] == [0.10525059698894745, 0.01000000003249999]
assert log.select("avg")[-1] == pytest.approx(53.3333, abs=1e-4)
assert log.select("std")[-1] == pytest.approx(83.7987, abs=1e-4)
assert pop[0][0] == pytest.approx(0.10525059698894745, abs=1e-6)
assert pop[0][1] == pytest.approx(0.01000000003249999, abs=1e-6)


@pytest.mark.unit
Expand All @@ -55,6 +56,7 @@ def test_optimisationsCMA_MO_run():
)
pop, hof, log, hist = optimisation.run(max_ngen=2)

assert abs(log.select("avg")[-1] - 40.) < 1e-4
assert abs(log.select("std")[-1] - 16.32993) < 1e-4
assert pop[0] == [0.09601241274168831, 0.024646650865379722]
assert log.select("avg")[-1] == pytest.approx(40., abs=1e-4)
assert log.select("std")[-1] == pytest.approx(16.32993, abs=1e-4)
assert pop[0][0] == pytest.approx(0.09601241274168831, abs=1e-6)
assert pop[0][1] == pytest.approx(0.024646650865379722, abs=1e-6)
329 changes: 0 additions & 329 deletions examples/l5pc/mechanisms/ProbAMPANMDA_EMS.mod

This file was deleted.

Loading