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

Method test_legadd

numpy/polynomial/tests/test_legendre.py:49–57  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

47 x = np.linspace(-1, 1, 100)
48
49 def test_legadd(self):
50 for i in range(5):
51 for j in range(5):
52 msg = f"At i={i}, j={j}"
53 tgt = np.zeros(max(i, j) + 1)
54 tgt[i] += 1
55 tgt[j] += 1
56 res = leg.legadd([0]*i + [1], [0]*j + [1])
57 assert_equal(trim(res), trim(tgt), err_msg=msg)
58
59 def test_legsub(self):
60 for i in range(5):

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
trimFunction · 0.70
maxFunction · 0.50

Tested by

no test coverage detected