1. 05 Jan, 2018 1 commit
  2. 01 Jan, 2018 1 commit
  3. 31 Dec, 2017 2 commits
    • Release Manager's avatar
      Trac #24450: BruhatTitsTree.lift: bail out if matrix is not invertible · 0b8763d9
      Release Manager authored
      If the determinant of the matrix is zero, the code does some very
      dubious things which happen to fail in the right way mostly by accident.
      This happens to break #24247, but it's clear that checking for a zero
      determinant makes sense anyway.
      
      URL: https://trac.sagemath.org/24450
      Reported by: jdemeyer
      Ticket author(s): Jeroen Demeyer
      Reviewer(s): David Roe
      0b8763d9
    • Release Manager's avatar
      Trac #21353: fix `MIPVariable` inheritance · a0634c97
      Release Manager authored
      Let `MIPVariable` not inherit from `Element` but `SageObject`. The only
      reason it used to be this way is to be able to multiply variables with
      scalars that can be dealt with in other ways. The previous inheritance
      scheme used the old parent framework that we try to get rid of.
      
      See also the task ticket: #21380
      
      URL: https://trac.sagemath.org/21353
      Reported by: vdelecroix
      Ticket author(s): Vincent Delecroix, Travis Scrimshaw
      Reviewer(s): Vincent Delecroix, Travis Scrimshaw
      a0634c97
  4. 30 Dec, 2017 7 commits
    • Jeroen Demeyer's avatar
    • Release Manager's avatar
      Trac #10720: nth_root for (Laurent) power series · 94238811
      Release Manager authored
      There is a nth_root method defined on univariate polynomial (via Newton
      method)
      {{{
      sage: R.<x> = QQ[]
      sage: ((1 + x - x^2)**5).nth_root(5)
      -x^2 + x + 1
      }}}
      We provide a more general implementation in a new method
      `_nth_root_series` that compute the series expansion of the n-th root
      for univariate polynomials. Using it we implement straightforward
      `nth_root` for univariate (Laurent) power series.
      
      This branch will not consider support for `extend=True` (see this
      [[https://groups.google.com/forum/#!topic/sage-devel/ijYyZ4IduF0|sage-
      devel thread]]). When `extend=True` the method will simply raise a
      `NotImplementedError` while waiting for Puiseux series in Sage (see
      #4618).
      
      On multi-variate polynomials there is also a `nth_root` method but which
      is implemented via factorization (sic)! The multivariate case should
      just call the univariate case with appropriate variable ordering. This
      will be dealt with in another ticket.
      
      URL: https://trac.sagemath.org/10720
      Reported by: pernici
      Ticket author(s): Mario Pernici, Vincent Delecroix
      Reviewer(s): Sébastien Labbé
      94238811
    • Release Manager's avatar
      Trac #24441: Expression evaluation needs forever · 4c8f71ac
      Release Manager authored
      Indirectly found by a `random_expr()` run:
      {{{
      sage: exp_polar(arcsec(jacobi_sn(1.1*I*x, x)))
      
      ...doesn't return. When stopped we find ourselves in Maxima:
      
      /home/ralf/sage/src/sage/symbolic/function.pyx in
      sage.symbolic.function.BuiltinFunction.__call__
      (build/cythonized/sage/symbolic/function.cpp:11630)()
          992             res = self._evalf_try_(*args)
          993             if res is None:
      --> 994                 res = super(BuiltinFunction, self).__call__(
          995                         *args, coerce=coerce, hold=hold)
          996
      
      /home/ralf/sage/src/sage/symbolic/function.pyx in
      sage.symbolic.function.Function.__call__
      (build/cythonized/sage/symbolic/function.cpp:6670)()
          486             res = g_function_evalv(self._serial, vec, hold)
          487         elif self._nargs == 1:
      --> 488             res = g_function_eval1(self._serial,
          489                     (<Expression>args[0])._gobj, hold)
          490         elif self._nargs == 2:
      
      /home/ralf/sage/src/sage/symbolic/function.pyx in
      sage.symbolic.function.BuiltinFunction._evalf_or_eval_
      (build/cythonized/sage/symbolic/function.cpp:12909)()
         1080         res = self._evalf_try_(*args)
         1081         if res is None:
      -> 1082             return self._eval0_(*args)
         1083         else:
         1084             return res
      
      /home/ralf/sage/local/lib/python2.7/site-packages/sage/functions/log.pyc
      in _eval_(self, z)
         1066         """
         1067         if (isinstance(z, Expression)
      -> 1068             and bool(-const_pi < z.imag_part() <= const_pi)):
         1069             return exp(z)
         1070         else:
      
      /home/ralf/sage/src/sage/symbolic/expression.pyx in
      sage.symbolic.expression.Expression.__nonzero__
      (build/cythonized/sage/symbolic/expression.cpp:19904)()
         2835             # lot of basic Sage objects can't be put into
      maxima.
         2836             from sage.symbolic.relation import
      test_relation_maxima
      -> 2837             return test_relation_maxima(self)
         2838
         2839         self_is_zero = self._gobj.is_zero()
      
      /home/ralf/sage/local/lib/python2.7/site-
      packages/sage/symbolic/relation.pyc in test_relation_maxima(relation)
          514     else: # operator is < or > or <= or >=, which Maxima handles
      fine
          515         try:
      --> 516             s = m.parent()._eval_line('is (%s)'%repr(m))
          517         except TypeError:
          518             raise ValueError("unable to evaluate the predicate
      '%s'" % repr(relation))
      
      /home/ralf/sage/local/lib/python2.7/site-
      packages/sage/interfaces/maxima_lib.pyc in _eval_line(self, line,
      locals, reformat, **kwds)
          450                     line = line[ind_semi+1:]
          451                 if statement:
      --> 452                     result = ((result + '\n') if result else '')
      + max_to_string(maxima_eval("#$%s$"%statement))
          453             else:
          454                 statement = line[:ind_dollar]
      
      /home/ralf/sage/src/sage/libs/ecl.pyx in
      sage.libs.ecl.EclObject.__call__
      (build/cythonized/sage/libs/ecl.c:8466)()
          800         """
          801         lispargs = EclObject(list(args))
      --> 802         return
      ecl_wrap(ecl_safe_apply(self.obj,(<EclObject>lispargs).obj))
          803
          804     def __richcmp__(left, right, int op):
      
      /home/ralf/sage/src/sage/libs/ecl.pyx in sage.libs.ecl.ecl_safe_apply
      (build/cythonized/sage/libs/ecl.c:6082)()
          373     if ecl_nvalues > 1:
          374         s = si_coerce_to_base_string(ecl_values(1))
      --> 375         raise RuntimeError("ECL says:
      "+ecl_base_string_pointer_safe(s))
          376     else:
          377         return ecl_values(0)
      
      RuntimeError: ECL says: Console interrupt.
      }}}
      The Maxima problem should be reported elsewhere. The bug in Sage is that
      the `exp_polar` code uses `bool(-const_pi < z.imag_part() <= const_pi)`
      to check the argument is in an interval but the argument can have
      symbols and in that case a proof is attempted unnecessarily.
      
      The ticket should change the `exp_polar` code such that the proof is
      only attempted with nonsymbolic argument.
      
      URL: https://trac.sagemath.org/24441
      Reported by: rws
      Ticket author(s): Ralf Stephan
      Reviewer(s): Travis Scrimshaw
      4c8f71ac
    • Release Manager's avatar
      Trac #24434: faster reduced words · f4e3f251
      Release Manager authored
      Since it is usually infeasible to compute all reduced words of a
      permutation, an iterator may be more convenient.
      
      As a side effect, the performance is also a bit better.  Old:
      {{{
      sage: %timeit [len(pi.reduced_words()) for pi in Permutations(6)]
      1 loop, best of 3: 42.3 s per loop
      sage: version()
      'SageMath version 8.2.beta1, Release Date: 2017-12-22'
      }}}
      
      New:
      {{{
      sage: %timeit [len(pi.reduced_words()) for pi in Permutations(6)]
      1 loop, best of 3: 4.9 s per loop
      }}}
      
      URL: https://trac.sagemath.org/24434
      Reported by: mantepse
      Ticket author(s): Martin Rubey
      Reviewer(s): Darij Grinberg, Travis Scrimshaw
      f4e3f251
    • Vincent Delecroix's avatar
      21353: extra doctest · 76c7fab2
      Vincent Delecroix authored
      76c7fab2
    • Martin Rubey's avatar
      use list to turn iterator into list · bed22efa
      Martin Rubey authored
      bed22efa
    • Travis Scrimshaw's avatar
      Merge branch 'public/categoires/some_cleanup-21353' of... · 5897f6da
      Travis Scrimshaw authored
      Merge branch 'public/categoires/some_cleanup-21353' of git://trac.sagemath.org/sage into public/categoires/some_cleanup-21353
      5897f6da
  5. 28 Dec, 2017 3 commits
    • Ralf Stephan's avatar
      24441: Expression evaluation needs forever · 258e397b
      Ralf Stephan authored
      258e397b
    • Release Manager's avatar
      Trac #23845: Doctest improvements to symbolic GCD · d595265e
      Release Manager authored
      The following all give errors:
      {{{
      sage: gcd(I-I*x, x^2-1)
      sage: gcd(I+I*x, x^2-1)
      sage: alg = SR(QQbar(sqrt(2)+I*sqrt(3)))
      sage: gcd(alg+alg*x, x^2-1)
      sage: gcd(alg-alg*x, x^2-1)
      sage: sqrt2 = SR(QQbar(sqrt(2)))
      sage: gcd(sqrt2+sqrt2*x, x^2-1)
      sage: gcd(sqrt2-sqrt2*x, x^2-1)
      }}}
      This is fixed in Pynac master and should be doctested here.
      
      Note that although Singular supports algebraic GCD Pynac uses Singular
      only in rational mode. Use a dedicated polynomial ring instead of
      symbolics if you want algebraic GCD.
      
      URL: https://trac.sagemath.org/23845
      Reported by: rws
      Ticket author(s): Ralf Stephan
      Reviewer(s): Travis Scrimshaw
      d595265e
    • Release Manager's avatar
      Trac #23545: Doctest: segmentation fault with coefficients() on symbolic expressions · e2464927
      Release Manager authored
      On sage 8.0
      {{{
      sage: (x^2/(1+x)).coefficients()
      Segmentation fault (core dumped)
      }}}
      
      gdb shows that this is an infinite recursion in the Pynac library:
      {{{
      #0  GiNaC::add::integer_content (this=0x4095f00) at normal.cpp:95
      #1  0x00007fff50051660 in GiNaC::ex::integer_content
      (this=this@entry=0x7fffff7ff410) at normal.cpp:81
      #2  0x00007fff50076fdc in GiNaC::power::eval (this=0x7fffff800040,
      level=<optimized out>) at power.cpp:674
      #3  0x00007fff4ff9b29e in GiNaC::ex::construct_from_basic (other=...) at
      ex.cpp:691
      #4  0x00007fff50041ac3 in ex (other=..., this=0x7fffff800030) at
      ex.h:305
      #5  GiNaC::mul::combine_ex_with_coeff_to_pair (this=0x40961a0, e=...,
      c=...) at mul.cpp:1228
      #6  0x00007fff4ffa3084 in GiNaC::expairseq::evalchildren
      (this=this@entry=0x40961a0, level=1) at expairseq.cpp:1647
      #7  0x00007fff50047390 in GiNaC::mul::eval (this=0x40961a0,
      level=<optimized out>) at mul.cpp:666
      #8  0x00007fff4ff9b29e in GiNaC::ex::construct_from_basic (other=...) at
      ex.cpp:691
      #9  0x00007fff50049ff6 in ex (other=..., this=0x7fffff800690) at
      ex.h:305
      #10 GiNaC::mul::expand (this=0x4096030, options=0) at mul.cpp:1490
      #11 0x00007fff4ff9ac0d in GiNaC::ex::expand
      (this=this@entry=0x7fffff800bf0, options=options@entry=0) at ex.cpp:84
      #12 0x00007fff4ff9eec9 in expand (options=0, thisex=...) at ex.h:701
      #13 GiNaC::match_monom (term=..., symb=..., vec=..., map=...) at
      ex.cpp:523
      #14 0x00007fff4ff9f8c8 in GiNaC::ex::coefficients
      (this=this@entry=0x7fffff800e00, s=..., vec=...) at ex.cpp:576
      #15 0x00007fff4ff9eed7 in GiNaC::match_monom (term=..., symb=...,
      vec=..., map=...) at ex.cpp:523
      #16 0x00007fff4ff9f8c8 in GiNaC::ex::coefficients
      (this=this@entry=0x7fffff8011c0, s=..., vec=...) at ex.cpp:576
      #17 0x00007fff4ff9eed7 in GiNaC::match_monom (term=..., symb=...,
      vec=..., map=...) at ex.cpp:523
      #18 0x00007fff4ff9f8c8 in GiNaC::ex::coefficients
      (this=this@entry=0x7fffff801580, s=..., vec=...) at ex.cpp:576
      #19 0x00007fff4ff9eed7 in GiNaC::match_monom (term=..., symb=...,
      vec=..., map=...) at ex.cpp:523
      #20 0x00007fff4ff9f8c8 in GiNaC::ex::coefficients
      (this=this@entry=0x7fffff801940, s=..., vec=...) at ex.cpp:576
      [...]
      }}}
      
      URL: https://trac.sagemath.org/23545
      Reported by: vdelecroix
      Ticket author(s): Ralf Stephan
      Reviewer(s): Travis Scrimshaw
      e2464927
  6. 27 Dec, 2017 7 commits
  7. 26 Dec, 2017 8 commits
  8. 25 Dec, 2017 4 commits
    • Release Manager's avatar
      Trac #24358: Random failure in time_alloc_list · 87a552de
      Release Manager authored
      {{{
      **********************************************************************
      File "src/sage/rings/real_double.pyx", line 2790, in
      sage.rings.real_double.time_alloc_list
      Failed example:
          time_alloc_list(2)
      Expected:
          [2.2, 2.1]
      Got:
          [0.0, 1.0]
      **********************************************************************
      1 item had failures:
         1 of   4 in sage.rings.real_double.time_alloc_list
          [421 tests, 1 failure, 0.58 s]
      ----------------------------------------------------------------------
      sage -t --long src/sage/rings/real_double.pyx  # 1 doctest failed
      ----------------------------------------------------------------------
      }}}
      
      URL: https://trac.sagemath.org/24358
      Reported by: vbraun
      Ticket author(s): Jeroen Demeyer
      Reviewer(s): Volker Braun
      87a552de
    • Release Manager's avatar
      Trac #24222: py3: simplified string conversion utilities · bbd5bdbc
      Release Manager authored
      A possible alternative to #24186, implementing simple conversion from C
      `char` arrays or `bytes` objects to `str` objects, and of `str` objects
      to `bytes` objects.  Here "`str`" and "`bytes`" are to be read exactly
      for either Python 2 or Python 3, so on Python 2 this means no conversion
      is performed since `str is bytes == True`.
      
      One thing this does not do is implement any kind of conversion from
      Python 2 `unicode` objects to `bytes`.  This functionality might be
      worth adding, in some form, to `str_to_bytes`.  But this would add a
      ''new'' feature on Python 2, whereas for now I'm only trying to preserve
      the existing functionality on Python 2 exactly, while transparently
      supporting Python 3 `str`s everywhere that Python 2 `str`s are
      supported.
      
      URL: https://trac.sagemath.org/24222
      Reported by: embray
      Ticket author(s): Erik Bray, Jeroen Demeyer
      Reviewer(s): Jeroen Demeyer, Erik Bray
      bbd5bdbc
    • Release Manager's avatar
      Trac #24402: Clean up MPFR and MPFI declarations · 6103d53a
      Release Manager authored
      URL: https://trac.sagemath.org/24402
      Reported by: jdemeyer
      Ticket author(s): Jeroen Demeyer
      Reviewer(s): Travis Scrimshaw
      6103d53a
    • Release Manager's avatar
      Trac #24378: complex_root_of uses inexact index · dc26f0de
      Release Manager authored
      When numerically evaluating `complex_root_of(a, k)`, the index `k` is
      passed as floating-point number:
      {{{
      sage: complex_root_of(x^8-1, 7).n(2)
      ------------------------------------------------------------------------
      ---
      IndexError                                Traceback (most recent call
      last)
      <ipython-input-1-4eba84b7c14c> in <module>()
      ----> 1 complex_root_of(x**Integer(8)-Integer(1),
      Integer(7)).n(Integer(2))
      
      /home/patchbot/sage-patchbot/src/sage/structure/element.pyx in
      sage.structure.element.Element.n
      (build/cythonized/sage/structure/element.c:8131)()
          863             0.666666666666667
          864         """
      --> 865         return self.numerical_approx(prec, digits, algorithm)
          866
          867     N = deprecated_function_alias(13055, n)
      
      /home/patchbot/sage-patchbot/src/sage/symbolic/expression.pyx in
      sage.symbolic.expression.Expression.numerical_approx
      (build/cythonized/sage/symbolic/expression.cpp:36209)()
         5818         kwds = {'parent': R, 'algorithm': algorithm}
         5819         try:
      -> 5820             x = x._convert(kwds)
         5821         except TypeError: # numerical approximation for real
      number failed
         5822             pass          # try again with complex
      
      /home/patchbot/sage-patchbot/src/sage/symbolic/expression.pyx in
      sage.symbolic.expression.Expression._convert
      (build/cythonized/sage/symbolic/expression.cpp:10663)()
         1257         sig_on()
         1258         try:
      -> 1259             res = self._gobj.evalf(0, kwds)
         1260         finally:
         1261             sig_off()
      
      /home/patchbot/sage-patchbot/local/lib/python2.7/site-
      packages/sage/functions/other.pyc in _evalf_(self, poly, index, parent,
      algorithm)
         2918         except AttributeError:
         2919             prec = 53
      -> 2920         sobj = CRootOf(Poly(poly._sympy_()), int(index))
         2921         return sobj.n(ceil(prec*3/10))._sage_()
         2922
      
      /home/patchbot/sage-patchbot/local/lib/python2.7/site-
      packages/sympy/polys/rootoftools.pyc in __new__(cls, f, x, index,
      radicals, expand)
          130         if index < -degree or index >= degree:
          131             raise IndexError("root index out of [%d, %d] range,
      got %d" %
      --> 132                              (-degree, degree - 1, index))
          133         elif index < 0:
          134             index += degree
      
      IndexError: root index out of [-8, 7] range, got 8
      }}}
      
      When `gmpy2` is installed, the index is even passed as complex number:
      {{{
      sage -t --long src/sage/functions/other.py
      **********************************************************************
      File "src/sage/functions/other.py", line 2862, in
      sage.functions.other.Function_crootof
      Failed example:
          c.n()
      Exception raised:
          Traceback (most recent call last):
            File "/home/patchbot/sage-patchbot/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 517, in _run
              self.compile_and_execute(example, compiler, test.globs)
            File "/home/patchbot/sage-patchbot/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 920, in compile_and_execute
              exec(compiled, globs)
            File "<doctest sage.functions.other.Function_crootof[1]>", line 1,
      in <module>
              c.n()
            File "sage/structure/element.pyx", line 865, in
      sage.structure.element.Element.n
      (build/cythonized/sage/structure/element.c:8131)
              return self.numerical_approx(prec, digits, algorithm)
            File "sage/symbolic/expression.pyx", line 5824, in
      sage.symbolic.expression.Expression.numerical_approx
      (build/cythonized/sage/symbolic/expression.cpp:36286)
              x = x._convert(kwds)
            File "sage/symbolic/expression.pyx", line 1259, in
      sage.symbolic.expression.Expression._convert
      (build/cythonized/sage/symbolic/expression.cpp:10663)
              res = self._gobj.evalf(0, kwds)
            File "/home/patchbot/sage-patchbot/local/lib/python2.7/site-
      packages/sage/functions/other.py", line 2920, in _evalf_
              sobj = CRootOf(Poly(poly._sympy_()), int(index))
            File "sage/rings/complex_number.pyx", line 1058, in
      sage.rings.complex_number.ComplexNumber.__int__
      (build/cythonized/sage/rings/complex_number.c:10918)
              raise TypeError("can't convert complex to int; use int(abs(z))")
          TypeError: can't convert complex to int; use int(abs(z))
      **********************************************************************
      File "src/sage/functions/other.py", line 2864, in
      sage.functions.other.Function_crootof
      Failed example:
          c.n(100)
      Exception raised:
          Traceback (most recent call last):
            File "/home/patchbot/sage-patchbot/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 517, in _run
              self.compile_and_execute(example, compiler, test.globs)
            File "/home/patchbot/sage-patchbot/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 920, in compile_and_execute
              exec(compiled, globs)
            File "<doctest sage.functions.other.Function_crootof[2]>", line 1,
      in <module>
              c.n(Integer(100))
            File "sage/structure/element.pyx", line 865, in
      sage.structure.element.Element.n
      (build/cythonized/sage/structure/element.c:8131)
              return self.numerical_approx(prec, digits, algorithm)
            File "sage/symbolic/expression.pyx", line 5824, in
      sage.symbolic.expression.Expression.numerical_approx
      (build/cythonized/sage/symbolic/expression.cpp:36286)
              x = x._convert(kwds)
            File "sage/symbolic/expression.pyx", line 1259, in
      sage.symbolic.expression.Expression._convert
      (build/cythonized/sage/symbolic/expression.cpp:10663)
              res = self._gobj.evalf(0, kwds)
            File "/home/patchbot/sage-patchbot/local/lib/python2.7/site-
      packages/sage/functions/other.py", line 2920, in _evalf_
              sobj = CRootOf(Poly(poly._sympy_()), int(index))
            File "sage/rings/complex_number.pyx", line 1058, in
      sage.rings.complex_number.ComplexNumber.__int__
      (build/cythonized/sage/rings/complex_number.c:10918)
              raise TypeError("can't convert complex to int; use int(abs(z))")
          TypeError: can't convert complex to int; use int(abs(z))
      **********************************************************************
      File "src/sage/functions/other.py", line 2866, in
      sage.functions.other.Function_crootof
      Failed example:
          (c^6 + c + 1).n(100) < 1e-25
      Exception raised:
          Traceback (most recent call last):
            File "/home/patchbot/sage-patchbot/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 517, in _run
              self.compile_and_execute(example, compiler, test.globs)
            File "/home/patchbot/sage-patchbot/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 920, in compile_and_execute
              exec(compiled, globs)
            File "<doctest sage.functions.other.Function_crootof[3]>", line 1,
      in <module>
              (c**Integer(6) + c + Integer(1)).n(Integer(100)) <
      RealNumber('1e-25')
            File "sage/structure/element.pyx", line 865, in
      sage.structure.element.Element.n
      (build/cythonized/sage/structure/element.c:8131)
              return self.numerical_approx(prec, digits, algorithm)
            File "sage/symbolic/expression.pyx", line 5824, in
      sage.symbolic.expression.Expression.numerical_approx
      (build/cythonized/sage/symbolic/expression.cpp:36286)
              x = x._convert(kwds)
            File "sage/symbolic/expression.pyx", line 1259, in
      sage.symbolic.expression.Expression._convert
      (build/cythonized/sage/symbolic/expression.cpp:10663)
              res = self._gobj.evalf(0, kwds)
            File "/home/patchbot/sage-patchbot/local/lib/python2.7/site-
      packages/sage/functions/other.py", line 2920, in _evalf_
              sobj = CRootOf(Poly(poly._sympy_()), int(index))
            File "sage/rings/complex_number.pyx", line 1058, in
      sage.rings.complex_number.ComplexNumber.__int__
      (build/cythonized/sage/rings/complex_number.c:10918)
              raise TypeError("can't convert complex to int; use int(abs(z))")
          TypeError: can't convert complex to int; use int(abs(z))
      **********************************************************************
      File "src/sage/functions/other.py", line 2908, in
      sage.functions.other.Function_crootof._evalf_
      Failed example:
          complex_root_of(x^2-2, 1).n()
      Exception raised:
          Traceback (most recent call last):
            File "/home/patchbot/sage-patchbot/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 517, in _run
              self.compile_and_execute(example, compiler, test.globs)
            File "/home/patchbot/sage-patchbot/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 920, in compile_and_execute
              exec(compiled, globs)
            File "<doctest sage.functions.other.Function_crootof._evalf_[0]>",
      line 1, in <module>
              complex_root_of(x**Integer(2)-Integer(2), Integer(1)).n()
            File "sage/structure/element.pyx", line 865, in
      sage.structure.element.Element.n
      (build/cythonized/sage/structure/element.c:8131)
              return self.numerical_approx(prec, digits, algorithm)
            File "sage/symbolic/expression.pyx", line 5824, in
      sage.symbolic.expression.Expression.numerical_approx
      (build/cythonized/sage/symbolic/expression.cpp:36286)
              x = x._convert(kwds)
            File "sage/symbolic/expression.pyx", line 1259, in
      sage.symbolic.expression.Expression._convert
      (build/cythonized/sage/symbolic/expression.cpp:10663)
              res = self._gobj.evalf(0, kwds)
            File "/home/patchbot/sage-patchbot/local/lib/python2.7/site-
      packages/sage/functions/other.py", line 2920, in _evalf_
              sobj = CRootOf(Poly(poly._sympy_()), int(index))
            File "sage/rings/complex_number.pyx", line 1058, in
      sage.rings.complex_number.ComplexNumber.__int__
      (build/cythonized/sage/rings/complex_number.c:10918)
              raise TypeError("can't convert complex to int; use int(abs(z))")
          TypeError: can't convert complex to int; use int(abs(z))
      **********************************************************************
      2 items had failures:
         3 of   5 in sage.functions.other.Function_crootof
         1 of   3 in sage.functions.other.Function_crootof._evalf_
          [622 tests, 4 failures, 17.27 s]
      sage -t --long src/sage/interfaces/sympy.py
      **********************************************************************
      File "src/sage/interfaces/sympy.py", line 617, in
      sage.interfaces.sympy._sympysage_crootof
      Failed example:
          (sols[0]+1)._sage_().n()
      Exception raised:
          Traceback (most recent call last):
            File "/home/patchbot/sage-patchbot/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 517, in _run
              self.compile_and_execute(example, compiler, test.globs)
            File "/home/patchbot/sage-patchbot/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 920, in compile_and_execute
              exec(compiled, globs)
            File "<doctest sage.interfaces.sympy._sympysage_crootof[6]>", line
      1, in <module>
              (sols[Integer(0)]+Integer(1))._sage_().n()
            File "sage/structure/element.pyx", line 865, in
      sage.structure.element.Element.n
      (build/cythonized/sage/structure/element.c:8131)
              return self.numerical_approx(prec, digits, algorithm)
            File "sage/symbolic/expression.pyx", line 5824, in
      sage.symbolic.expression.Expression.numerical_approx
      (build/cythonized/sage/symbolic/expression.cpp:36286)
              x = x._convert(kwds)
            File "sage/symbolic/expression.pyx", line 1259, in
      sage.symbolic.expression.Expression._convert
      (build/cythonized/sage/symbolic/expression.cpp:10663)
              res = self._gobj.evalf(0, kwds)
            File "/home/patchbot/sage-patchbot/local/lib/python2.7/site-
      packages/sage/functions/other.py", line 2920, in _evalf_
              sobj = CRootOf(Poly(poly._sympy_()), int(index))
            File "sage/rings/complex_number.pyx", line 1058, in
      sage.rings.complex_number.ComplexNumber.__int__
      (build/cythonized/sage/rings/complex_number.c:10918)
              raise TypeError("can't convert complex to int; use int(abs(z))")
          TypeError: can't convert complex to int; use int(abs(z))
      **********************************************************************
      1 item had failures:
         1 of   8 in sage.interfaces.sympy._sympysage_crootof
          [218 tests, 1 failure, 3.27 s]
      }}}
      
      URL: https://trac.sagemath.org/24378
      Reported by: jdemeyer
      Ticket author(s): Ralf Stephan
      Reviewer(s): Jeroen Demeyer
      dc26f0de
  9. 24 Dec, 2017 3 commits
    • Release Manager's avatar
      Trac #24424: Dancing links random failures · 8afbd544
      Release Manager authored
      The output of `one_solution` is random:
      {{{
      **********************************************************************
      File "src/sage/combinat/matrices/dancing_links.pyx", line 27, in
      sage.combinat.matrices.dancing_links
      Failed example:
          sorted(x.one_solution(ncpus=8))
      Expected:
          [0, 1]
      Got:
          [2, 3]
      **********************************************************************
      1 item had failures:
         1 of  20 in sage.combinat.matrices.dancing_links
          [175 tests, 1 failure, 8.38 s]
      ----------------------------------------------------------------------
      sage -t --long src/sage/combinat/matrices/dancing_links.pyx  # 1 doctest
      failed
      ----------------------------------------------------------------------
      }}}
      Also, does ncpus=8 really use 8 cores? We already parallelize doctests!
      Tests should definitely not x8 that.
      
      URL: https://trac.sagemath.org/24424
      Reported by: vbraun
      Ticket author(s): Sébastien Labbé
      Reviewer(s): Volker Braun
      8afbd544
    • Release Manager's avatar
      Trac #24264: Allow "generic" PolynomialRing implementation · 8a8e61d5
      Release Manager authored
      It is possible to specify a specific backend like `PolynomialRing(QQ,
      'x', implementation="singular")` but the opposite (asking for a generic
      Sage implementation) is not. Fix this by allowing
      `implementation="generic"`.
      
      This requires various fixes involving the `implementation` keyword being
      ignored or breaking caching. In particular, we fix this caching bug:
      {{{
      sage: p = 2^64 + 13
      sage: A = GF(p^2)
      sage: B = GF(p^3)
      sage: R = A.modulus().parent()
      sage: S = B.modulus().parent()
      sage: R is S
      False
      }}}
      
      We also introduce a new implementation "GF2X" for the GF2X package. This
      used be called "NTL" which we still allow as alias.
      
      URL: https://trac.sagemath.org/24264
      Reported by: jdemeyer
      Ticket author(s): Jeroen Demeyer
      Reviewer(s): Travis Scrimshaw
      8a8e61d5
    • Sébastien Labbé's avatar
      24424: fixing random doctests failures · 2df8c973
      Sébastien Labbé authored
      2df8c973
  10. 23 Dec, 2017 4 commits