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

Method test_scalar

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

Source from the content-addressed store, hash-verified

1379 assert_array_equal(r, [1, 6, 1, 2])
1380
1381 def test_scalar(self):
1382 def addsubtract(a, b):
1383 if a > b:
1384 return a - b
1385 else:
1386 return a + b
1387
1388 f = vectorize(addsubtract)
1389 r = f([0, 3, 6, 9], 5)
1390 assert_array_equal(r, [5, 8, 1, 4])
1391
1392 def test_large(self):
1393 x = np.linspace(-3, 2, 10000)

Callers

nothing calls this directly

Calls 3

vectorizeClass · 0.90
assert_array_equalFunction · 0.90
fFunction · 0.85

Tested by

no test coverage detected