Hi,

On Wed, Dec 02, 2009 at 04:21:46PM -0800, Ondrej Certik wrote:
> One last thing --- all tests+doctests pass, but some documentation
> tests fail and I think at least some of them may indicate some bugs,
> that should be fixed and regular tests written for:
> 
> **********************************************************************
> File "doc/src/modules/polynomials.txt", line 36, in polynomials.txt
> Failed example:
>     q
> Expected:
>           5*x
>     5/2 + ---
>            2
> Got:
>     0
> **********************************************************************
> File "doc/src/modules/polynomials.txt", line 40, in polynomials.txt
> Failed example:
>     r
> Expected:
>     -2
> Got:
>                   2
>     3 + 10*x + 5*x
> **********************************************************************
> File "doc/src/modules/polynomials.txt", line 74, in polynomials.txt
> Failed example:
>     q
> Expected:
>     y
>     -
>     3
> Got:
>     0
> **********************************************************************
> File "doc/src/modules/polynomials.txt", line 78, in polynomials.txt
> Failed example:
>     r
> Expected:
>     0
> Got:
>     x*y + y*z
> **********************************************************************
> File "doc/src/modules/polynomials.txt", line 89, in polynomials.txt
> Failed example:
>     q
> Expected:
>       2*a   b   a*x
>     - --- + - + ---
>        9    3    3
> Got:
>     0
> **********************************************************************
> File "doc/src/modules/polynomials.txt", line 93, in polynomials.txt
> Failed example:
>     r
> Expected:
>         2*b   4*a
>     c - --- + ---
>          3     9
> Got:
>                  2
>     c + b*x + a*x
> **********************************************************************
> File "doc/src/modules/polynomials.txt", line 106, in polynomials.txt
> Failed example:
>     q, r = div(f, [g1, g2], x, y, z)
> Exception raised:
>     Traceback (most recent call last):
>       File "/usr/lib/python2.6/doctest.py", line 1241, in __run
>         compileflags, 1) in test.globs
>       File "<doctest polynomials.txt[33]>", line 1, in <module>
>         q, r = div(f, [g1, g2], x, y, z)
>       File "/home/ondrej/repos/sympy/sympy/polys/polytools.py", line
> 1453, in div
>         F, G = poly_coerce(f, g, *gens, **args)
>       File "/home/ondrej/repos/sympy/sympy/polys/polytools.py", line
> 1355, in poly_coerce
>         Poly(g, *gens, **args))
>       File "/home/ondrej/repos/sympy/sympy/polys/polytools.py", line
> 400, in __new__
>         if rep.is_Poly:
>     AttributeError: 'list' object has no attribute 'is_Poly'
> **********************************************************************
> File "doc/src/modules/polynomials.txt", line 107, in polynomials.txt
> Failed example:
>     q
> Expected:
>                    z
>     [y + z, -1/2 + -]
>                    2
> Got:
>     0
> **********************************************************************
> File "doc/src/modules/polynomials.txt", line 111, in polynomials.txt
> Failed example:
>     r
> Expected:
>           3*z
>     1/2 - ---
>            2
> Got:
>                  2
>     c + b*x + a*x
> **********************************************************************
> File "doc/src/modules/polynomials.txt", line 115, in polynomials.txt
> Failed example:
>     (q[0]*g1 + q[1]*g2 + r).expand()
> Exception raised:
>     Traceback (most recent call last):
>       File "/usr/lib/python2.6/doctest.py", line 1241, in __run
>         compileflags, 1) in test.globs
>       File "<doctest polynomials.txt[36]>", line 1, in <module>
>         (q[0]*g1 + q[1]*g2 + r).expand()
>     TypeError: 'Zero' object does not support indexing
> **********************************************************************
> File "doc/src/modules/polynomials.txt", line 118, in polynomials.txt
> Failed example:
>     q, r = div(f, [g2, g1], x, y, z)
> Exception raised:
>     Traceback (most recent call last):
>       File "/usr/lib/python2.6/doctest.py", line 1241, in __run
>         compileflags, 1) in test.globs
>       File "<doctest polynomials.txt[37]>", line 1, in <module>
>         q, r = div(f, [g2, g1], x, y, z)
>       File "/home/ondrej/repos/sympy/sympy/polys/polytools.py", line
> 1453, in div
>         F, G = poly_coerce(f, g, *gens, **args)
>       File "/home/ondrej/repos/sympy/sympy/polys/polytools.py", line
> 1355, in poly_coerce
>         Poly(g, *gens, **args))
>       File "/home/ondrej/repos/sympy/sympy/polys/polytools.py", line
> 400, in __new__
>         if rep.is_Poly:
>     AttributeError: 'list' object has no attribute 'is_Poly'
> **********************************************************************
> File "doc/src/modules/polynomials.txt", line 119, in polynomials.txt
> Failed example:
>     q
> Expected:
>      x   z
>     [- + -, -1/2 + z]
>      2   2
> Got:
>     0
> **********************************************************************
> File "doc/src/modules/polynomials.txt", line 123, in polynomials.txt
> Failed example:
>     r
> Expected:
>           3*z
>     1/2 - ---
>            2
> Got:
>                  2
>     c + b*x + a*x
> **********************************************************************
> File "doc/src/modules/polynomials.txt", line 127, in polynomials.txt
> Failed example:
>     (q[0]*g2 + q[1]*g1 + r).expand()
> Exception raised:
>     Traceback (most recent call last):
>       File "/usr/lib/python2.6/doctest.py", line 1241, in __run
>         compileflags, 1) in test.globs
>       File "<doctest polynomials.txt[40]>", line 1, in <module>
>         (q[0]*g2 + q[1]*g1 + r).expand()
>     TypeError: 'Zero' object does not support indexing
> **********************************************************************
> File "doc/src/modules/polynomials.txt", line 177, in polynomials.txt
> Failed example:
>     sqf((x + 2)*(x*(x + 1))**2, x)
> Expected:
>                  2
>     [2 + x, x + x ]
> Got:
>             2
>     /     2\
>     \x + x / *(2 + x)
> **********************************************************************
> File "doc/src/modules/polynomials.txt", line 242, in polynomials.txt
> Failed example:
>     solve_poly_system([y**2 - x**3 + 1, y*x], x, y)
> Exception raised:
>     Traceback (most recent call last):
>       File "/usr/lib/python2.6/doctest.py", line 1241, in __run
>         compileflags, 1) in test.globs
>       File "<doctest polynomials.txt[65]>", line 1, in <module>
>         solve_poly_system([y**2 - x**3 + 1, y*x], x, y)
>       File "/home/ondrej/repos/sympy/sympy/solvers/polysys.py", line
> 103, in solve_poly_system
>         solutions = solve_reduced_system(system, gens, entry=True)
>       File "/home/ondrej/repos/sympy/sympy/solvers/polysys.py", line
> 93, in solve_reduced_system
>         for solution in solve_reduced_system(new_system, new_gens):
>       File "/home/ondrej/repos/sympy/sympy/solvers/polysys.py", line
> 57, in solve_reduced_system
>         basis = groebner(system, *gens, polys=True)
>       File "/home/ondrej/repos/sympy/sympy/polys/polytools.py", line
> 1902, in groebner
>         for g in sdp_groebner(F, lev, order, dom) ]
>       File "/home/ondrej/repos/sympy/sympy/polys/groebnertools.py",
> line 581, in sdp_groebner
>         R, P, G, B = generate(R, P, G, B)
>       File "/home/ondrej/repos/sympy/sympy/polys/groebnertools.py",
> line 548, in generate
>         h = normal(F[R.pop()], G | P)
>       File "/home/ondrej/repos/sympy/sympy/polys/groebnertools.py",
> line 533, in normal
>         h = sdp_rem(g, [ F[j] for j in J ], u, O, K)
>       File "/home/ondrej/repos/sympy/sympy/polys/groebnertools.py",
> line 391, in sdp_rem
>         return sdp_div(f, g, u, O, K)[1]
>       File "/home/ondrej/repos/sympy/sympy/polys/groebnertools.py",
> line 376, in sdp_div
>         tq = term_div(sdp_LT(f, u, K), sdp_LT(g, u, K), K)
>       File "/home/ondrej/repos/sympy/sympy/polys/groebnertools.py",
> line 345, in _term_ff_div
>         return monom, K.exquo(a_lc, b_lc)
>       File "/home/ondrej/repos/sympy/sympy/polys/algebratools.py",
> line 423, in exquo
>         return a / b
>     TypeError: unsupported operand type(s) for /: 'Fraction' and 'DMF'
> **********************************************************************
> 

Yes, I'm aware of this issue. I didn't study those errors in detail yet,
but a brief look into the above output reveals that most of them are just
side effects of changed interface, e.g.:

>     sqf((x + 2)*(x*(x + 1))**2, x)

In the new module sqf_list() does what sqf() did previously:

In [1]: sqf((x + 2)*(x*(x + 1))**2, x)
Out[1]: 
        2        
⎛     2⎞         
⎝x + x ⎠ ⋅(2 + x)

In [2]: sqf_list((x + 2)*(x*(x + 1))**2, x)
Out[2]: 
⎛   ⎡            ⎛     2   ⎞⎤⎞
⎝1, ⎣(2 + x, 1), ⎝x + x , 2⎠⎦⎠

> --
> 
> 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.
> 
> 

-- 
Mateusz

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to