#10925: Better error messages for bad arrow plots
---------------------------+------------------------------------------------
Reporter: kcrisman | Owner: jason, was
Type: enhancement | Status: new
Priority: minor | Milestone:
Component: graphics | Keywords: beginner
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
---------------------------+------------------------------------------------
The error messages for bad arrow setups are somewhat amusing.
{{{
sage: version()
'Sage Version 4.6.2, Release Date: 2011-02-25'
sage: arrow([1,2,1],[2,1])
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (2, 0))
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (844, 0))
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/Applications/MathApps/sage/local/lib/python2.6/site-
packages/sage/plot/arrow.pyc in arrow(tailpoint, headpoint, **kwds)
342 except ValueError:
343 from sage.plot.plot3d.shapes import arrow3d
--> 344 return arrow3d(tailpoint, headpoint, **kwds)
345
346 @rename_keyword(color='rgbcolor')
/Applications/MathApps/sage/local/lib/python2.6/site-
packages/sage/misc/decorators.pyc in wrapper(*args, **kwds)
571 kwds[new_name] = kwds[old_name]
572 del kwds[old_name]
--> 573 return func(*args, **kwds)
574
575 return wrapper
/Applications/MathApps/sage/local/lib/python2.6/site-
packages/sage/plot/plot3d/shapes.so in sage.plot.plot3d.shapes.arrow3d
(sage/plot/plot3d/shapes.c:5870)()
/Applications/MathApps/sage/local/lib/python2.6/site-
packages/sage/structure/element.so in
sage.structure.element.ModuleElement.__sub__
(sage/structure/element.c:8080)()
/Applications/MathApps/sage/local/lib/python2.6/site-
packages/sage/structure/coerce.so in
sage.structure.coerce.CoercionModel_cache_maps.bin_op
(sage/structure/coerce.c:6996)()
TypeError: unsupported operand parent(s) for '-': 'Vector space of
dimension 2 over Real Double Field' and 'Vector space of dimension 3 over
Real Double Field'
}}}
and
{{{sage: arrow([1],[1])
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (2, 0))
---------------------------------------------------------------------------
ArithmeticError Traceback (most recent call
last)
/Applications/MathApps/sage/local/lib/python2.6/site-
packages/sage/plot/arrow.pyc in arrow(tailpoint, headpoint, **kwds)
342 except ValueError:
343 from sage.plot.plot3d.shapes import arrow3d
--> 344 return arrow3d(tailpoint, headpoint, **kwds)
345
346 @rename_keyword(color='rgbcolor')
/Applications/MathApps/sage/local/lib/python2.6/site-
packages/sage/misc/decorators.pyc in wrapper(*args, **kwds)
571 kwds[new_name] = kwds[old_name]
572 del kwds[old_name]
--> 573 return func(*args, **kwds)
574
575 return wrapper
/Applications/MathApps/sage/local/lib/python2.6/site-
packages/sage/plot/plot3d/shapes.so in sage.plot.plot3d.shapes.arrow3d
(sage/plot/plot3d/shapes.c:6038)()
/Applications/MathApps/sage/local/lib/python2.6/site-
packages/sage/modules/free_module_element.so in
sage.modules.free_module_element.FreeModuleElement.cross_product
(sage/modules/free_module_element.c:10882)()
ArithmeticError: Cross product only defined for vectors of length three or
seven, not (3 and 1)
}}}
I leave the traces in for those who want to fix this; tentatively saying
beginner. Ideally, we should plot one-dimensional arrows as well (such as
how we plot one-dimensional vectors), or should this remain impossible?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10925>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.