Comment #1 on issue 2133 by asmeurer: Merge new polynomials manipulation module
http://code.google.com/p/sympy/issues/detail?id=2133

I don't know how to run cythonized tests. Otherwise, I have tested every combination, except that I do not have 64-bit Python 2.4 and I do not have gmpy installed for Python 2.4.

All the test failures that I see in the ode module can be changed. They are simply a result of dsolve returning a different solution due to better simplification (things like sqrt(2 + a) instead of sqrt(8 + 4*a)/2). Actually, you don't have to worry too much about updating dsolve tests in cases like this because each test is verified with checkodesol().

I also get a failure with ratint.  Basically, we are now getting:

In [36]: ratint(1/(x**2 + 1), x, real=False)
Out[36]:
       ⎛   2                          ⎞
RootSum⎝4⋅t  + 1, Λ(t, t⋅log(x + 2⋅t))⎠

instead of

In [37]: ratint(1/(x**2 + 1), x, real=False)
Out[37]:
ⅈ⋅log(x + ⅈ)   ⅈ⋅log(x - ⅈ)
──────────── - ────────────
     2              2

which I guess is wrong. This is probably similar to the issue in comment 16 of issue 2132.

I get this failure with python ground types in 32-bit Python 2.6 and 64-bit Python 2.7 (just those two),

______________ sympy/polys/tests/test_polytools.py:test_intervals ______________ File "/users/aaronmeurer/documents/python/sympy/sympy/sympy/polys/tests/test_polytools.py", line 1841, in test_intervals [((-S(71)/5, -S(85)/6), {1: 1}), ((-S(85)/6, -14), {0: 1}), ((14, S(85)/6), {0: 1}), ((S(85)/6, S(71)/5), {1: 1})]
AssertionError

I too get the failure in Python 2.4.  This is the traceback:

Traceback (most recent call last):
  File "setup.py", line 262, in ?
    cmdclass    = {'test': test_sympy,
File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/distutils/core.py", line 149, in setup
    dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/distutils/dist.py", line 946, in run_commands
    self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/distutils/dist.py", line 966, in run_command
    cmd_obj.run()
  File "setup.py", line 159, in run
    if sympy.test():
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/utilities/runtests.py", line 141, in test
    return t.test(sort=sort)
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/utilities/runtests.py", line 316, in test
    self.test_file(f)
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/utilities/runtests.py", line 351, in test_file
    if isgeneratorfunction(funcs[i]):
IndexError: list index out of range

However, there is a failure in Python 2.4 that you won't see when you run all the tests because of this. You can get it by running python2.4 bin/test sympy/polys/tests/test_polyroots.py. The failure is

____________ sympy/polys/tests/test_polyroots.py:test_roots_quartic ____________ File "/users/aaronmeurer/documents/python/sympy/sympy/sympy/polys/tests/test_polyroots.py", line 68, in test_roots_quartic
    assert all([eq.subs(x, ai).n(chop=True) == 0 for ai in ans])
NameError: global name 'all' is not defined

Actually, this failure also exists in master, but it's in the polys module, so you might as well fix it.

There are four additional doctest failures not related to issue 2041. The ode ones just need to be updated to show the new thing (similar to the ode failures above). For the other, you just need to update the symbols() syntax:

____________________ sympy.core.function.expand_multinomial ____________________ File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/function.py", line 1036, in sympy.core.function.expand_multinomial
Failed example:
    x, y = symbols('xy', positive=True)
Exception raised:
    Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/doctest.py", line 1248, in __run
        compileflags, 1) in test.globs
File "<doctest sympy.core.function.expand_multinomial[1]>", line 1, in ?
        x, y = symbols('xy', positive=True)
    TypeError: unpack non-sequence
**********************************************************************
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/function.py", line 1037, in sympy.core.function.expand_multinomial
Failed example:
    expand_multinomial((x + exp(x + 1))**2)
Exception raised:
    Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/doctest.py", line 1248, in __run
        compileflags, 1) in test.globs
File "<doctest sympy.core.function.expand_multinomial[2]>", line 1, in ?
        expand_multinomial((x + exp(x + 1))**2)
    NameError: name 'x' is not defined
________________________________________________________________________________
_______________________ sympy.solvers.ode.ode_Liouville ________________________ File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/solvers/ode.py", line 2130, in sympy.solvers.ode.ode_Liouville
Failed example:
    pprint(dsolve(diff(f(x), x, x) + diff(f(x), x)**2/f(x) +
    diff(f(x), x)/x, f(x), hint='Liouville'))
Expected:
               ________________           ________________
    [f(x) = -\/ C1 + C2*log(x) , f(x) = \/ C1 + C2*log(x) ]
Got:
               ___   ________________           ___   ________________
    [f(x) = -\/ 2 *\/ C1 + C2*log(x) , f(x) = \/ 2 *\/ C1 + C2*log(x) ]
________________________________________________________________________________
________ sympy.solvers.ode.ode_1st_homogeneous_coeff_subs_indep_div_dep ________ File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/solvers/ode.py", line 1756, in sympy.solvers.ode.ode_1st_homogeneous_coeff_subs_indep_div_dep
Failed example:
    pprint(dsolve(genform, f(x),
    hint='1st_homogeneous_coeff_subs_indep_div_dep_Integral'))
Expected:
                 x
                ----
                f(x)
                  /
                 |
                 |       -g(u2)
                 |  ---------------- d(u2)
                 |  u2*g(u2) + h(u2)
                 |
                /
    f(x) = C1*e
Got:
                 x
                ----
                f(x)
                  /
                 |
                 |        g(u2)
                 |  ----------------- d(u2)
                 |  -h(u2) - u2*g(u2)
                 |
                /
    <BLANKLINE>
    f(x) = C1*e
________________________________________________________________________________
__________________________ sympy.solvers.ode.odesimp ___________________________ File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/solvers/ode.py", line 136, in sympy.solvers.ode.odesimp
Failed example:
    pprint(eq)
Expected:
        x
       ----
       f(x)
         /
        |
        |                  /1 \
        |        1 + u2*sin|--|
        |                  \u2/                  /f(x)\
    -   |  -------------------------- d(u2) + log|----| = 0
        |    /          /1 \\                    \ C1 /
        |  - |1 + u2*sin|--||*u2 + u2
        |    \          \u2//
        |
       /
    <BLANKLINE>
Got:
        x
       ----
       f(x)
         /
        |
        |   /          /1 \\
        |  -|1 + u2*sin|--||
        |   \          \u2//            /f(x)\
    -   |  ----------------- d(u2) + log|----| = 0
        |       2    /1 \               \ C1 /
        |     u2 *sin|--|
        |            \u2/
        |
       /
    <BLANKLINE>

============ tests finished: 779 passed, 4 failed, in 88.63 seconds ============

There is an XPass test in test_ode.py that passes everywhere, so it can probably be converted to a regular test (there must be a bug in the test runner, because it won't tell me which test it is).

Finally, consider cherry-picking the remaining polys related fixes from my integration3 branch. The remaining doctests aren't too important for the release, but the remainder are bug fixes that would be nice to have.

--
You received this message because you are subscribed to the Google Groups 
"sympy-patches" group.
To post to this group, send email to sympy-patc...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-patches+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-patches?hl=en.

Reply via email to