Skip to content

Commit

Permalink
Fixed test for asynchronous parallel circuit (#173)
Browse files Browse the repository at this point in the history
* Fixed a bug in the calculator destructor

* Fixed problem with process pool destruction

* The design of the example is brought to a single sample

* Fixed test for asynchronous parallel circuit
  • Loading branch information
LebedevIlyaG authored Dec 7, 2023
1 parent 6647f28 commit 7ae8ab4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/iOpt/method/test_async_parallel_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,17 @@ def setUp(self):
def test_Solve(self):
self.async_parallel_process.solve()
items = self.async_parallel_process.search_data.get_last_items(5)
self.assertAlmostEqual(-1 / 3, items[0].get_y().float_variables[0])
self.assertAlmostEqual(1 / 3, items[1].get_y().float_variables[0])
self.assertAlmostEqual(2 / 3, items[2].get_y().float_variables[0])
self.assertAlmostEqual(0.0, items[3].get_y().float_variables[0])
self.assertAlmostEqual(-1 / 3, items[1].get_y().float_variables[0])
self.assertAlmostEqual(1 / 3, items[2].get_y().float_variables[0])
self.assertAlmostEqual(2 / 3, items[3].get_y().float_variables[0])
self.assertAlmostEqual(-2 / 3, items[4].get_y().float_variables[0])
self.assertAlmostEqual(
0.0,
1 / 3,
self.async_parallel_process.search_data.solution.best_trials[0]
.point.float_variables[0],
)
self.assertAlmostEqual(
0.0,
1 / 9,
self.async_parallel_process.search_data.solution.best_trials[0]
.function_values[0].value,
)
Expand Down

0 comments on commit 7ae8ab4

Please sign in to comment.