MCPcopy Index your code
hub / github.com/numpy/numpy / test_pow

Function test_pow

numpy/polynomial/tests/test_classes.py:513–529  ·  view source on GitHub ↗
(Poly)

Source from the content-addressed store, hash-verified

511
512
513def test_pow(Poly):
514 d = Poly.domain + random((2,)) * .25
515 w = Poly.window + random((2,)) * .25
516 tgt = Poly([1], domain=d, window=w)
517 tst = Poly([1, 2, 3], domain=d, window=w)
518 for i in range(5):
519 assert_poly_almost_equal(tst**i, tgt)
520 tgt = tgt * tst
521 # default domain and window
522 tgt = Poly([1])
523 tst = Poly([1, 2, 3])
524 for i in range(5):
525 assert_poly_almost_equal(tst**i, tgt)
526 tgt = tgt * tst
527 # check error for invalid powers
528 assert_raises(ValueError, op.pow, tgt, 1.5)
529 assert_raises(ValueError, op.pow, tgt, -1)
530
531
532def test_call(Poly):

Callers

nothing calls this directly

Calls 3

assert_raisesFunction · 0.90
PolyFunction · 0.85
assert_poly_almost_equalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…