Tests the computation of the centroid of all clients in the data instance.
(ok_small)
| 395 | |
| 396 | |
| 397 | def test_centroid(ok_small): |
| 398 | """ |
| 399 | Tests the computation of the centroid of all clients in the data instance. |
| 400 | """ |
| 401 | centroid = ok_small.centroid() |
| 402 | x = [client.x for client in ok_small.clients()] |
| 403 | y = [client.y for client in ok_small.clients()] |
| 404 | |
| 405 | assert_allclose(centroid[0], np.mean(x)) |
| 406 | assert_allclose(centroid[1], np.mean(y)) |
| 407 | |
| 408 | |
| 409 | def test_matrix_access(): |