MCPcopy Create free account
hub / github.com/numpy/numpy / test_simple

Method test_simple

numpy/lib/tests/test_function_base.py:1370–1379  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1368class TestVectorize:
1369
1370 def test_simple(self):
1371 def addsubtract(a, b):
1372 if a > b:
1373 return a - b
1374 else:
1375 return a + b
1376
1377 f = vectorize(addsubtract)
1378 r = f([0, 3, 6, 9], [1, 3, 5, 7])
1379 assert_array_equal(r, [1, 6, 1, 2])
1380
1381 def test_scalar(self):
1382 def addsubtract(a, b):

Callers

nothing calls this directly

Calls 3

vectorizeClass · 0.90
assert_array_equalFunction · 0.90
fFunction · 0.85

Tested by

no test coverage detected