MCPcopy Create free account
hub / github.com/ddbourgin/numpy-ml / test_manhattan

Function test_manhattan

numpy_ml/tests/test_utils.py:162–173  ·  view source on GitHub ↗
(N=1)

Source from the content-addressed store, hash-verified

160
161
162def test_manhattan(N=1):
163 np.random.seed(12345)
164 i = 0
165 while i < N:
166 N = np.random.randint(1, 100)
167 x = np.random.rand(N)
168 y = np.random.rand(N)
169 mine = manhattan(x, y)
170 theirs = scipy.spatial.distance.cityblock(x, y)
171 np.testing.assert_almost_equal(mine, theirs)
172 print("PASSED")
173 i += 1
174
175
176#######################################################################

Callers

nothing calls this directly

Calls 1

manhattanFunction · 0.90

Tested by

no test coverage detected