MCPcopy Create free account
hub / github.com/PyVRP/PyVRP / test_centroid

Function test_centroid

tests/test_ProblemData.py:397–406  ·  view source on GitHub ↗

Tests the computation of the centroid of all clients in the data instance.

(ok_small)

Source from the content-addressed store, hash-verified

395
396
397def 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
409def test_matrix_access():

Callers

nothing calls this directly

Calls 1

clientsMethod · 0.80

Tested by

no test coverage detected