Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some doctests fail for me locally #25788

Open
moorepants opened this issue Oct 12, 2023 · 2 comments
Open

Some doctests fail for me locally #25788

moorepants opened this issue Oct 12, 2023 · 2 comments

Comments

@moorepants
Copy link
Member

$ bin/doctest doc/src/
=================================================================================== rst/md doctests start ====================================================================================
executable:         /home/moorepants/miniconda/bin/python  (3.9.18-final-0) [CPython]
architecture:       64-bit
cache:              yes
ground types:       gmpy 2.1.2
numpy:              1.24.4
hash randomization: on (PYTHONHASHSEED=265324655)

doc/src/contributing/dependencies.md [2]                                                                                                                                                  [OK]
doc/src/contributing/docstring.rst [24]                                                                                                                                                   [OK]
doc/src/contributing/new-contributors-guide/workflow-process.md [5]                                                                                                                       [OK]
doc/src/contributing/new-contributors-guide/writing-tests.md [31]                                                                                                                         [OK]
doc/src/explanation/active-deprecations.md [85]                                                                                                                                           [OK]
doc/src/explanation/gotchas.rst [137]                                                                                                                                                     [OK]
doc/src/explanation/solve_output.rst [30]                                                                                                                                                 [OK]
doc/src/explanation/special_topics/classification.rst [23]                                                                                                                                [OK]
doc/src/explanation/special_topics/finite_diff_derivatives.rst [65]                                                                                                                       [OK]
doc/src/guides/assumptions.rst [202]                                                                                                                                                      [OK]
doc/src/guides/booleans.rst [95]                                                                                                                                                          [OK]
doc/src/guides/custom-functions.md [172]                                                                                                                                                  [OK]
doc/src/guides/physics/control_problems.rst [84]                                                                                                                                          [OK]
**********************************************************************
File "/home/moorepants/src/sympy/doc/src/guides/solving/find-roots-polynomial.md", line 506, in find-roots-polynomial.md
Failed example:
    r = r0, r1, r2, r3, r4 = Poly(fifth_order, x).all_roots(); r
Expected:
            / 5           \         / 5           \         / 5           \        >
    [CRootOf\x  - x + 1, 0/, CRootOf\x  - x + 1, 1/, CRootOf\x  - x + 1, 2/, CRoot >
    <BLANKLINE>
    >   / 5           \         / 5           \
    > Of\x  - x + 1, 3/, CRootOf\x  - x + 1, 4/]
Got:
            / 5           \         / 5           \         / 5           \         / 5           \         / 5           \ 
    [CRootOf\x  - x + 1, 0/, CRootOf\x  - x + 1, 1/, CRootOf\x  - x + 1, 2/, CRootOf\x  - x + 1, 3/, CRootOf\x  - x + 1, 4/]
**********************************************************************
1 items had failures:
   1 of  87 in find-roots-polynomial.md
***Test Failed*** 1 failures.
doc/src/guides/solving/find-roots-polynomial.md [87]                                                                                                                                       [1]
doc/src/guides/solving/reduce-inequalities-algebraically.md [52]                                                                                                                          [OK]
doc/src/guides/solving/solve-diophantine-equation.md [75]                                                                                                                                 [OK]
doc/src/guides/solving/solve-equation-algebraically.md [91]                                                                                                                               [OK]
**********************************************************************
File "/home/moorepants/src/sympy/doc/src/guides/solving/solve-matrix-equation.md", line 228, in solve-matrix-equation.md
Failed example:
    A.det()
Expected:
    A₀₀⋅A₁₁⋅A₂₂⋅A₃₃ - A₀₀⋅A₁₁⋅A₂₃⋅A₃₂ - A₀₀⋅A₁₂⋅A₂₁⋅A₃₃ + A₀₀⋅A₁₂⋅A₂₃⋅A₃₁ + A₀₀⋅A₁ ↪
    <BLANKLINE>
    ↪ ₃⋅A₂₁⋅A₃₂ - A₀₀⋅A₁₃⋅A₂₂⋅A₃₁ - A₀₁⋅A₁₀⋅A₂₂⋅A₃₃ + A₀₁⋅A₁₀⋅A₂₃⋅A₃₂ + A₀₁⋅A₁₂⋅A₂ ↪
    <BLANKLINE>
    ↪ ₀⋅A₃₃ - A₀₁⋅A₁₂⋅A₂₃⋅A₃₀ - A₀₁⋅A₁₃⋅A₂₀⋅A₃₂ + A₀₁⋅A₁₃⋅A₂₂⋅A₃₀ + A₀₂⋅A₁₀⋅A₂₁⋅A₃ ↪
    <BLANKLINE>
    ↪ ₃ - A₀₂⋅A₁₀⋅A₂₃⋅A₃₁ - A₀₂⋅A₁₁⋅A₂₀⋅A₃₃ + A₀₂⋅A₁₁⋅A₂₃⋅A₃₀ + A₀₂⋅A₁₃⋅A₂₀⋅A₃₁ -  ↪
    <BLANKLINE>
    ↪ A₀₂⋅A₁₃⋅A₂₁⋅A₃₀ - A₀₃⋅A₁₀⋅A₂₁⋅A₃₂ + A₀₃⋅A₁₀⋅A₂₂⋅A₃₁ + A₀₃⋅A₁₁⋅A₂₀⋅A₃₂ - A₀₃⋅ ↪
    <BLANKLINE>
    ↪ A₁₁⋅A₂₂⋅A₃₀ - A₀₃⋅A₁₂⋅A₂₀⋅A₃₁ + A₀₃⋅A₁₂⋅A₂₁⋅A₃₀
Got:
    A₀₀⋅A₁₁⋅A₂₂⋅A₃₃ - A₀₀⋅A₁₁⋅A₂₃⋅A₃₂ - A₀₀⋅A₁₂⋅A₂₁⋅A₃₃ + A₀₀⋅A₁₂⋅A₂₃⋅A₃₁ + A₀₀⋅A₁₃⋅A₂₁⋅A₃₂ - A₀₀⋅A₁₃⋅A₂₂⋅A₃₁ - A₀₁⋅A₁₀⋅A₂₂⋅A₃₃ + A₀₁⋅A₁₀⋅A₂₃⋅A₃₂ + A₀₁⋅A₁₂⋅A₂₀⋅A₃₃ - A₀₁⋅A₁₂⋅A₂₃⋅A₃₀ - A₀₁⋅A₁₃⋅ ↪
    <BLANKLINE>
    ↪ A₂₀⋅A₃₂ + A₀₁⋅A₁₃⋅A₂₂⋅A₃₀ + A₀₂⋅A₁₀⋅A₂₁⋅A₃₃ - A₀₂⋅A₁₀⋅A₂₃⋅A₃₁ - A₀₂⋅A₁₁⋅A₂₀⋅A₃₃ + A₀₂⋅A₁₁⋅A₂₃⋅A₃₀ + A₀₂⋅A₁₃⋅A₂₀⋅A₃₁ - A₀₂⋅A₁₃⋅A₂₁⋅A₃₀ - A₀₃⋅A₁₀⋅A₂₁⋅A₃₂ + A₀₃⋅A₁₀⋅A₂₂⋅A₃₁ + A₀₃⋅A₁₁⋅A₂₀⋅A₃ ↪
    <BLANKLINE>
    ↪ ₂ - A₀₃⋅A₁₁⋅A₂₂⋅A₃₀ - A₀₃⋅A₁₂⋅A₂₀⋅A₃₁ + A₀₃⋅A₁₂⋅A₂₁⋅A₃₀
**********************************************************************
1 items had failures:
   1 of  61 in solve-matrix-equation.md
***Test Failed*** 1 failures.
doc/src/guides/solving/solve-matrix-equation.md [61]                                                                                                                                       [1]
doc/src/guides/solving/solve-numerically.md [53]                                                                                                                                          [OK]
doc/src/guides/solving/solve-ode.md [100]                                                                                                                                                 [OK]
doc/src/guides/solving/solve-system-of-equations-algebraically.md [28]                                                                                                                    [OK]
doc/src/guides/solving/solving-guidance.md [59]                                                                                                                                           [OK]
doc/src/install.md [4]                                                                                                                                                                    [OK]
doc/src/modules/assumptions/index.rst [5]                                                                                                                                                 [OK]
**********************************************************************
File "/home/moorepants/src/sympy/doc/src/modules/codegen.rst", line 166, in codegen.rst
Failed example:
    mathematica_code(expr)
Expected:
    T*(x[-T]*Sin[(T + t)/T]/(T + t) + x[T]*Sin[(-T + t)/T]/(-T + t) + x[0]*Sin[t/T ↪
    <BLANKLINE>
    ↪ ]/t)
Got:
    T*(x[-T]*Sin[(T + t)/T]/(T + t) + x[T]*Sin[(-T + t)/T]/(-T + t) + x[0]*Sin[t/T]/t)
**********************************************************************
1 items had failures:
   1 of  93 in codegen.rst
***Test Failed*** 1 failures.
@oscarbenjamin
Copy link
Collaborator

I can reproduce this as well. I'm not sure why this doesn't show up in CI.

This comes from gh-25673 which should possibly be reverted anyway.

@smichr
Copy link
Member

smichr commented Oct 12, 2023

If the printer setting is wrap_line=False then the line continuation characters will not be included in render.

>>> init_printing(wrap_line=True,use_unicode=False)
>>> sum(symbols('x:40'))
x0 + x1 + x10 + x11 + x12 + x13 + x14 + x15 + x16 + x17 + x18 + x19 + x2 + x20 >


>  + x21 + x22 + x23 + x24 + x25 + x26 + x27 + x28 + x29 + x3 + x30 + x31 + x3 >


> 2 + x33 + x34 + x35 + x36 + x37 + x38 + x39 + x4 + x5 + x6 + x7 + x8 + x9
>>> init_printing(wrap_line=False,use_unicode=False)
>>> sum(symbols('x:40'))
x0 + x1 + x10 + x11 + x12 + x13 + x14 + x15 + x16 + x17 + x18 + x19 + x2 + x20 +
 x21 + x22 + x23 + x24 + x25 + x26 + x27 + x28 + x29 + x3 + x30 + x31 + x32 + x3
3 + x34 + x35 + x36 + x37 + x38 + x39 + x4 + x5 + x6 + x7 + x8 + x9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants