module documentation

Undocumented

Class TestFormat Undocumented
Class TestLatexRepr Test the latex repr used by Jupyter
Class TestLinebreaking Undocumented
Class TestPrintOptions Test the output is properly configured via printoptions. The exponential notation is enabled automatically when the values are too small or too large.
Class TestRepr Undocumented
Class TestStrAscii Undocumented
Class TestStrUnicodeSuperSubscripts Undocumented
Function test_complex_coefficients Test both numpy and built-in complex.
Function test_nonnumeric_object_coefficients Test coef fallback for object arrays of non-numeric coefficients.
Function test_numeric_object_coefficients Undocumented
Function test_set_default_printoptions Undocumented
Function test_symbol Undocumented
Constant SWITCH_TO_EXP Undocumented
def test_complex_coefficients(): (source)

Test both numpy and built-in complex.

@pytest.mark.parametrize(('coefs', 'tgt'), ((array([1, 2, 'f'], dtype=object), '1 + 2·x + f·x²'), (array([1, 2, [3, 4]], dtype=object), '1 + 2·x + [3, 4]·x²')))
def test_nonnumeric_object_coefficients(coefs, tgt): (source)

Test coef fallback for object arrays of non-numeric coefficients.

@pytest.mark.parametrize(('coefs', 'tgt'), ((array([Fraction(1, 2), Fraction(3, 4)], dtype=object), '1/2 + 3/4·x'), (array([1, 2, Fraction(5, 7)], dtype=object), '1 + 2·x + 5/7·x²'), (array([Decimal('1.00'), Decimal('2.2'), 3], dtype=object), '1.00 + 2.2·x + 3·x²')))
def test_numeric_object_coefficients(coefs, tgt): (source)

Undocumented

def test_set_default_printoptions(): (source)

Undocumented

@pytest.mark.parametrize(('poly', 'tgt'), ((poly.Polynomial, '1.0 + 2.0·z + 3.0·z²'), (poly.Chebyshev, '1.0 + 2.0·T₁(z) + 3.0·T₂(z)'), (poly.Hermite, '1.0 + 2.0·H₁(z) + 3.0·H₂(z)'), (poly.HermiteE, '1.0 + 2.0·He₁(z) + 3.0·He₂(z)'), (poly.Laguerre, '1.0 + 2.0·L₁(z) + 3.0·L₂(z)'), (poly.Legendre, '1.0 + 2.0·P₁(z) + 3.0·P₂(z)')))
def test_symbol(poly, tgt): (source)

Undocumented

SWITCH_TO_EXP: tuple[str, ...] = (source)

Undocumented

Value
('1.0 + (1.0e-01) x + (1.0e-02) x**2',
 '1.2 + (1.2e-01) x + (1.2e-02) x**2',
 '1.23 + 0.12 x + (1.23e-02) x**2 + (1.23e-03) x**3',
 '1.235 + 0.123 x + (1.235e-02) x**2 + (1.235e-03) x**3',
 '1.2346 + 0.1235 x + 0.0123 x**2 + (1.2346e-03) x**3 + (1.2346e-04) x**4',
 '1.23457 + 0.12346 x + 0.01235 x**2 + (1.23457e-03) x**3 + (1.23457e-04) x**4',
 '1.234568 + 0.123457 x + 0.012346 x**2 + 0.001235 x**3 + (1.234568e-04) x**4 + 
...