#13246: Automatic exclusion of non-domain points in things like arcsec
-----------------------------------------+--------------------------
       Reporter:  kcrisman               |        Owner:  jason, was
           Type:  defect                 |       Status:  needs_work
       Priority:  major                  |    Milestone:  sage-6.3
      Component:  graphics               |   Resolution:
       Keywords:                         |    Merged in:
        Authors:  Punarbasu Purkayastha  |    Reviewers:
Report Upstream:  N/A                    |  Work issues:
         Branch:                         |       Commit:
   Dependencies:                         |     Stopgaps:
-----------------------------------------+--------------------------

Comment (by ppurka):

 The error about complex entries was introduced in between 5.10.rc1 and
 5.11.rc1

 Earlier it used to be a `ValueError` and was properly handled by the plot
 code:
 {{{
 sage: from sage.plot.misc import setup_for_eval_on_grid
 sage: f, d = setup_for_eval_on_grid(arcsec, [(-2, 2)])
 sage: xi = -0.992725195401
 sage: f(xi)
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)
 <ipython-input-4-f7215b663c19> in <module>()
 ----> 1 f(xi)

 /usr/local/src/sage/sage-5.10.rc1.server/local/lib/python2.7/site-
 packages/sage/ext/interpreters/wrapper_rdf.so in
 sage.ext.interpreters.wrapper_rdf.Wrapper_rdf.__call__
 (build/cythonized/sage/ext/interpreters/wrapper_rdf.c:1641)()

 /usr/local/src/sage/sage-5.10.rc1.server/local/lib/python2.7/site-
 packages/sage/symbolic/expression.so in
 sage.symbolic.expression.Expression.__float__
 (build/cythonized/sage/symbolic/expression.cpp:7218)()

 /usr/local/src/sage/sage-5.10.rc1.server/local/lib/python2.7/site-
 packages/sage/symbolic/expression.so in
 sage.symbolic.expression.Expression._eval_self
 (build/cythonized/sage/symbolic/expression.cpp:6246)()

 /usr/local/src/sage/sage-5.10.rc1.server/local/lib/python2.7/site-
 packages/sage/functions/trig.pyc in _evalf_(self, x, parent)
     731         """
     732         if parent is float:
 --> 733             return math.acos(1/x)
     734         return (1/x).arccos()
     735

 ValueError: math domain error
 }}}
 Now it spits out `AttributeError` instead.
 {{{
 sage: from sage.plot.misc import setup_for_eval_on_grid
 sage: f, d = setup_for_eval_on_grid(arcsec, [(-2, 2)])
 sage: xi = -0.992725195401
 sage: f(xi)
 ---------------------------------------------------------------------------
 AttributeError                            Traceback (most recent call
 last)
 <ipython-input-4-f7215b663c19> in <module>()
 ----> 1 f(xi)
 /usr/local/src/sage/sage-5.11.rc0/local/lib/python2.7/site-
 packages/sage/ext/interpreters/wrapper_rdf.so in
 sage.ext.interpreters.wrapper_rdf.Wrapper_rdf.__call__
 (sage/ext/interpreters/wrapper_rdf.c:1641)()
 /usr/local/src/sage/sage-5.11.rc0/local/lib/python2.7/site-
 packages/sage/symbolic/function.so in
 sage.symbolic.function.BuiltinFunction.__call__
 (sage/symbolic/function.cpp:8029)()
 /usr/local/src/sage/sage-5.11.rc0/local/lib/python2.7/site-
 packages/sage/symbolic/expression.so in
 sage.symbolic.expression.Expression.__complex__
 (sage/symbolic/expression.cpp:7805)()
 /usr/local/src/sage/sage-5.11.rc0/local/lib/python2.7/site-
 packages/sage/symbolic/expression.so in
 sage.symbolic.expression.Expression._eval_self
 (sage/symbolic/expression.cpp:6696)()
 /usr/local/src/sage/sage-5.11.rc0/local/lib/python2.7/site-
 packages/sage/functions/trig.pyc in _evalf_(self, x, parent)
     732         if parent is float:
     733             return math.acos(1/x)
 --> 734         return (1/x).arccos()
     735
     736     def _eval_numpy_(self, x):
 AttributeError: 'complex' object has no attribute 'arccos'
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/13246#comment:27>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to