Ask Your Question
1

parametric_plot gives "IndexError: list index out of range" in SageMath 8.1-11 on Arch Linux

asked 2018-04-10 01:28:05 +0200

cookchar gravatar image

updated 2018-10-08 00:30:32 +0200

tmonteil gravatar image

I've been attempting to plot a parabola, but I keep running into an error from the "expression_comparisons.py" file as an "index out of range" error. Help? My OS is Arch Linux, using the Cinnamon DE, and version 8.1-11 of Sagemath. Attempted code:

sage: var('t')
sage: parametric_plot((t,t^2),(t,-4,4))

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_11.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cGFyYW1ldHJpY19wbG90KCh0LHReMiksKHQsLTQsNCkp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>

  File "/tmp/tmpwjIIYE/___code___.py", line 3, in <module>
    exec compile(u'parametric_plot((t,t**_sage_const_2 ),(t,-_sage_const_4 ,_sage_const_4 ))
  File "", line 1, in <module>

  File "/usr/lib/python2.7/site-packages/sage/misc/decorators.py", line 564, in wrapper
    return func(*args, **options)
  File "/usr/lib/python2.7/site-packages/sage/plot/plot.py", line 2621, in parametric_plot
    return plot(funcs, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/sage/misc/decorators.py", line 564, in wrapper
    return func(*args, **options)
  File "/usr/lib/python2.7/site-packages/sage/plot/plot.py", line 1950, in plot
    G = _plot(funcs, *args, **kwds)
  File "/usr/lib/python2.7/site-packages/sage/plot/plot.py", line 2067, in _plot
    funcs, ranges = setup_for_eval_on_grid(funcs, [xrange], options['plot_points'])
  File "/usr/lib/python2.7/site-packages/sage/plot/misc.py", line 150, in setup_for_eval_on_grid
    return fast_float(funcs, *vars,**options), [tuple(range+[range_step]) for range,range_step in zip(ranges, range_steps)]
  File "sage/ext/fast_eval.pyx", line 1384, in sage.ext.fast_eval.fast_float (build/cythonized/sage/ext/fast_eval.c:11037)
  File "sage/ext/fast_eval.pyx", line 1399, in sage.ext.fast_eval.fast_float (build/cythonized/sage/ext/fast_eval.c:11258)
  File "sage/ext/fast_callable.pyx", line 465, in sage.ext.fast_callable.fast_callable (build/cythonized/sage/ext/fast_callable.c:4634)
  File "sage/symbolic/expression.pyx", line 11679, in sage.symbolic.expression.Expression._fast_callable_ (build/cythonized/sage/symbolic/expression.cpp:66334)
  File "/usr/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 1757, in fast_callable
    return FastCallableConverter(ex, etb)()
  File "/usr/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 218, in __call__
    return self.arithmetic(ex, operator)
  File "/usr/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 1670, in arithmetic
    exponent = operands[1]
IndexError: list index out of range
edit retag flag offensive close merge delete

Comments

Welcome to Ask Sage! Thank you for your question!

slelievre gravatar imageslelievre ( 2018-04-10 07:40:02 +0200 )edit

Strange; the command in the question should work without problem... Can you try as follows?

sage: parametric_plot((lambda t: t, lambda t: t^2), (-4, 4))
slelievre gravatar imageslelievre ( 2018-04-10 07:41:45 +0200 )edit

WorksForMe (TM) on version 8.2.beta8 running on Debian testing.

If you have access to another machine with a different platform, it might be worth testing it on that platform. It might be specific to your binary. Did you built it yourself, or was it packaged in Arch ?

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2018-04-10 10:21:42 +0200 )edit

It works for me as well, both with Sage 8.1 and Sage 8.2.rc1 (OS: Ubuntu 16.04).

eric_g gravatar imageeric_g ( 2018-04-10 13:18:02 +0200 )edit

@cookchar: if the answer by @arojas solves your question, please accept it by clicking the "accept" (tick mark) button next to it! This will mark your question as solved and the answer as accepted.

slelievre gravatar imageslelievre ( 2018-04-17 17:51:19 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-04-10 16:43:12 +0200

arojas gravatar image

Please test 8.1-12, 8.1-11 was broken due to a pynac upgrade.

edit flag offensive delete link more

Comments

Thank you @arojas for your answer and for maintaining the ArchLinux distribution of SageMath!

slelievre gravatar imageslelievre ( 2018-04-11 11:08:57 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2018-04-10 01:28:05 +0200

Seen: 756 times

Last updated: Apr 10 '18