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

Method test_latex

numpy/polynomial/tests/test_printing.py:526–536  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

524 '+ (1.429e+08) x**3')
525
526 def test_latex(self):
527 p = poly.Polynomial([1 / 2, 1 / 7, 1 / 7 * 10**8, 1 / 7 * 10**9])
528 assert_equal(p._repr_latex_(),
529 r'$x \mapsto \text{0.5} + \text{0.14285714}\,x + '
530 r'\text{14285714.28571429}\,x^{2} + '
531 r'\text{(1.42857143e+08)}\,x^{3}$')
532
533 with printoptions(precision=3):
534 assert_equal(p._repr_latex_(),
535 r'$x \mapsto \text{0.5} + \text{0.143}\,x + '
536 r'\text{14285714.286}\,x^{2} + \text{(1.429e+08)}\,x^{3}$')
537
538 def test_fixed(self):
539 p = poly.Polynomial([1 / 2])

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
printoptionsFunction · 0.90
_repr_latex_Method · 0.80

Tested by

no test coverage detected