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

py3: progress on symbolic/expression.pyx #28140

Closed
jhpalmieri opened this issue Jul 8, 2019 · 6 comments
Closed

py3: progress on symbolic/expression.pyx #28140

jhpalmieri opened this issue Jul 8, 2019 · 6 comments

Comments

@jhpalmieri
Copy link
Member

Some fixes to Python 3 doctests in symbolic/expression.pyx.

Component: python3

Author: John Palmieri

Branch/Commit: 23b22f8

Reviewer: Frédéric Chapoton

Issue created by migration from https://trac.sagemath.org/ticket/28140

@jhpalmieri jhpalmieri added this to the sage-8.9 milestone Jul 8, 2019
@jhpalmieri
Copy link
Member Author

Branch: u/jhpalmieri/py3-expression

@jhpalmieri
Copy link
Member Author

comment:2

Remaining failures:

File "src/sage/symbolic/expression.pyx", line 1526, in sage.symbolic.expression.Expression.__hash__
Failed example:
    hash(SR(2^64-1)) == hash(2^64-1)
Expected:
    True
Got:
    False

Maybe this will require a pynac update.

Also I get intermittent failures which I have no idea what to do with:

File "src/sage/symbolic/expression.pyx", line 7119, in sage.symbolic.expression.Expression.gcd
Failed example:
    gcd(alg + alg*x, x^2 - 1)
Exception raised:
    Traceback (most recent call last):
      File "/Users/jpalmier/Desktop/Sage/sage_builds/PYTHON3/sage-8.9.beta1/local/lib/python3.7/site-packages/sage/arith/misc.py", line 1771, in gcd
        return m(b, **kwargs)
      File "sage/symbolic/expression.pyx", line 7166, in sage.symbolic.expression.Expression.gcd (build/cythonized/sage/symbolic/expression.cpp:40616)
        cdef GEx x = g_gcd(self._gobj, r._gobj)
      File "sage/structure/element.pyx", line 1236, in sage.structure.element.Element.__add__ (build/cythonized/sage/structure/element.c:10816)
        return coercion_model.bin_op(left, right, add)
      File "sage/structure/coerce.pyx", line 1207, in sage.structure.coerce.CoercionModel.bin_op (build/cythonized/sage/structure/coerce.c:10898)
        raise bin_op_exception(op, x, y)
    TypeError: unsupported operand parent(s) for +: 'Algebraic Real Field' and 'Number Field in I with defining polynomial x^2 + 1 with I = 1*I'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/Users/jpalmier/Desktop/Sage/sage_builds/PYTHON3/sage-8.9.beta1/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Users/jpalmier/Desktop/Sage/sage_builds/PYTHON3/sage-8.9.beta1/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 1105, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.symbolic.expression.Expression.gcd[14]>", line 1, in <module>
        gcd(alg + alg*x, x**Integer(2) - Integer(1))
      File "/Users/jpalmier/Desktop/Sage/sage_builds/PYTHON3/sage-8.9.beta1/local/lib/python3.7/site-packages/sage/arith/misc.py", line 1773, in gcd
        return m(py_scalar_to_element(b), **kwargs)
      File "sage/symbolic/expression.pyx", line 7166, in sage.symbolic.expression.Expression.gcd (build/cythonized/sage/symbolic/expression.cpp:40616)
        cdef GEx x = g_gcd(self._gobj, r._gobj)
      File "sage/structure/element.pyx", line 1236, in sage.structure.element.Element.__add__ (build/cythonized/sage/structure/element.c:10816)
        return coercion_model.bin_op(left, right, add)
      File "sage/structure/coerce.pyx", line 1207, in sage.structure.coerce.CoercionModel.bin_op (build/cythonized/sage/structure/coerce.c:10898)
        raise bin_op_exception(op, x, y)
    TypeError: unsupported operand parent(s) for +: 'Algebraic Real Field' and 'Number Field in I with defining polynomial x^2 + 1 with I = 1*I'
**********************************************************************
File "src/sage/symbolic/expression.pyx", line 7121, in sage.symbolic.expression.Expression.gcd
Failed example:
    gcd(alg - alg*x, x^2 - 1)
Exception raised:
    Traceback (most recent call last):
      File "/Users/jpalmier/Desktop/Sage/sage_builds/PYTHON3/sage-8.9.beta1/local/lib/python3.7/site-packages/sage/arith/misc.py", line 1771, in gcd
        return m(b, **kwargs)
      File "sage/symbolic/expression.pyx", line 7166, in sage.symbolic.expression.Expression.gcd (build/cythonized/sage/symbolic/expression.cpp:40616)
        cdef GEx x = g_gcd(self._gobj, r._gobj)
      File "sage/structure/element.pyx", line 1236, in sage.structure.element.Element.__add__ (build/cythonized/sage/structure/element.c:10816)
        return coercion_model.bin_op(left, right, add)
      File "sage/structure/coerce.pyx", line 1207, in sage.structure.coerce.CoercionModel.bin_op (build/cythonized/sage/structure/coerce.c:10898)
        raise bin_op_exception(op, x, y)
    TypeError: unsupported operand parent(s) for +: 'Algebraic Real Field' and 'Number Field in I with defining polynomial x^2 + 1 with I = 1*I'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/Users/jpalmier/Desktop/Sage/sage_builds/PYTHON3/sage-8.9.beta1/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Users/jpalmier/Desktop/Sage/sage_builds/PYTHON3/sage-8.9.beta1/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 1105, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.symbolic.expression.Expression.gcd[15]>", line 1, in <module>
        gcd(alg - alg*x, x**Integer(2) - Integer(1))
      File "/Users/jpalmier/Desktop/Sage/sage_builds/PYTHON3/sage-8.9.beta1/local/lib/python3.7/site-packages/sage/arith/misc.py", line 1773, in gcd
        return m(py_scalar_to_element(b), **kwargs)
      File "sage/symbolic/expression.pyx", line 7166, in sage.symbolic.expression.Expression.gcd (build/cythonized/sage/symbolic/expression.cpp:40616)
        cdef GEx x = g_gcd(self._gobj, r._gobj)
      File "sage/structure/element.pyx", line 1236, in sage.structure.element.Element.__add__ (build/cythonized/sage/structure/element.c:10816)
        return coercion_model.bin_op(left, right, add)
      File "sage/structure/coerce.pyx", line 1207, in sage.structure.coerce.CoercionModel.bin_op (build/cythonized/sage/structure/coerce.c:10898)
        raise bin_op_exception(op, x, y)
    TypeError: unsupported operand parent(s) for +: 'Algebraic Real Field' and 'Number Field in I with defining polynomial x^2 + 1 with I = 1*I'

New commits:

23b22f8trac 28140: py3 fixes for doctest failures in symbolic/expression.pyx

@jhpalmieri
Copy link
Member Author

Commit: 23b22f8

@fchapoton
Copy link
Contributor

comment:3

ok, any progress is good to take. Thanks a lot for working on the py3 transition, John.

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@vbraun
Copy link
Member

vbraun commented Jul 10, 2019

Changed branch from u/jhpalmieri/py3-expression to 23b22f8

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