ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 28 Nov 2014 20:45:53 +0100Untrusted group warninghttps://ask.sagemath.org/question/25043/untrusted-group-warning/I have 'installed' sage following [these](http://www.sagemath.org/doc/installation/binary.html) instructions, by just extracting the latests binary tarball and then adding a symbolic link like so: `ln -s ~/sage/sage /usr/local/bin/sage`
Now every time I execute a file with `sage path/to/file` I get the following warning:
sys:1: RuntimeWarning: not adding directory '' to sys.path since it's writable by an untrusted group.
Untrusted users could put fi les in this directory which might then be imported by your Python code. As a general precaution from similar exploits, you should not execute Python code from this directory
Especially during debugging sessions the additional output tends to clutter up my screen a lot and pushes away the meaningful output. Is there any way I can fix this?
kekxFri, 28 Nov 2014 20:45:53 +0100https://ask.sagemath.org/question/25043/Why does JMOL fail here?https://ask.sagemath.org/question/24401/why-does-jmol-fail-here/Sorry, but I can't think of a good title for the question. I put together code for the Menger's Sponge (3d) [EDIT: and ran it in a Sage notebook. I also tried it in a Sage Cell Server.]
H = J = K = Graphics()
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
H += cube().scale(1).translate(1/2+i, 1/2+j, 1/2+k)
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
J += H.translate(3/2+3*i, 3/2+3*j, 3/2+3*k)
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
K += J.translate(4.5+9*i, 4.5+9*j, 4.5+9*k)
#K.show()
K.save('Menger3.gif')
The code runs and creates the image of the 3rd iteration of Menger's sponge. But if I comment out: K.save('Menger3.gif') and uncomment K.show() then the code won't run. I get lots of errors like:
__main__:19: UserWarning: Duplicate name: 'obj_660992.pmesh'
after which I'm told
Traceback (click to the left of this block for traceback)
...
RuntimeError: Jmol failed to create file
'/tmp/tmpMSjmcm/.jmol_images/sage0-size500.jmol.png',
and I'm told to look at a temporary text file (which turns out to be empty).
So the questions are "Why does JMOL fail to create the third iteration of Menger's Sponge when I can view the image of it?", "How do I revise the code so JMOL won't fail?".
By the way, for the second iteration of Menger's Sponge, JMOL works.dazedANDconfusedMon, 06 Oct 2014 01:11:03 +0200https://ask.sagemath.org/question/24401/scary muli_polynomial_ring warninghttps://ask.sagemath.org/question/10426/scary-muli_polynomial_ring-warning/Thw following warning message looks pretty scary, since it is accompanied by a stack trace. And I have absolutely no idea (yet) as to what it is trying to tell me. Is the result it prints in the end reliable? If so, why the fuss? And if not, what is causing this problem? Is this an indication of a bug?
sage: R1.<cosAlpha, sinAlpha> = AA[]
sage: QR1 = R1.quotient(R1.ideal(cosAlpha^2 + sinAlpha^2 - 1))
sage: QR1(-8*sinAlpha - 4*sinAlpha*cosAlpha + 5*2*(2*sinAlpha*cosAlpha)*(cosAlpha*cosAlpha - sinAlpha*sinAlpha))
verbose 0 (3490: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
singular_ring_delete(ring*) called with NULL pointer.
File "<stdin>", line 1, in <module>
File "_sage_input_4.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("UVIxKC04KnNpbkFscGhhIC0gNCpzaW5BbHBoYSpjb3NBbHBoYSArIDUqMiooMipzaW5BbHBoYSpjb3NBbHBoYSkqKGNvc0FscGhhKmNvc0FscGhhIC0gc2luQWxwaGEqc2luQWxwaGEpKQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single')
File "", line 1, in <module>
File "/tmp/tmpKfaoEi/___code___.py", line 3, in <module>
exec compile(u'QR1(-_sage_const_8 *sinAlpha - _sage_const_4 *sinAlpha*cosAlpha + _sage_const_5 *_sage_const_2 *(_sage_const_2 *sinAlpha*cosAlpha)*(cosAlpha*cosAlpha - sinAlpha*sinAlpha))' + '\n', '', 'single')
File "", line 1, in <module>
File "sage/rings/quotient_ring.py", line 993, in _element_constructor_
return self.element_class(self, x)
File "sage/rings/quotient_ring_element.py", line 99, in __init__
self._reduce_()
File "sage/rings/quotient_ring_element.py", line 118, in _reduce_
self.__rep = I.reduce(self.__rep)
File "sage/rings/polynomial/multi_polynomial_ideal.py", line 4019, in reduce
strat = self._groebner_strategy()
File "sage/rings/polynomial/multi_polynomial_ideal.py", line 910, in _groebner_strategy
return GroebnerStrategy(MPolynomialIdeal(self.ring(), self.groebner_basis()))
Exception KeyError: (The ring pointer 0x0,) in 'sage.libs.singular.ring.singular_ring_delete' ignored
-40*cosAlphabar*sinAlphabar^3 + 16*cosAlphabar*sinAlphabar - 8*sinAlphabarMvGWed, 07 Aug 2013 10:06:35 +0200https://ask.sagemath.org/question/10426/How can you stop warnings from printing?https://ask.sagemath.org/question/10241/how-can-you-stop-warnings-from-printing/I am writing a quick and dirty poker program in python, and am getting a warning when doing:
def is_there_a_pair(hand,values=False):
if values: vals = hand
else:
vals = [val for (val,suit) in hand]
for item in arrangements(vals,2):
if item[0] == item[1]:
return item
The warning is the following: sagePoker.py:24: DeprecationWarning: Use Arrangements(mset,k).list() instead. See http://trac.sagemath.org/13821 for details.
But if I do the .list() method, I get this error. AttributeError: 'list' object has no attribute 'list'
Which makes me think doing .list() is useless
What do I do to either fix that erro from happening, or stop errors from printing?KevinShafferFri, 14 Jun 2013 17:21:06 +0200https://ask.sagemath.org/question/10241/Suppressing warning messageshttps://ask.sagemath.org/question/8166/suppressing-warning-messages/When I do the following sage code, I get a warning message::
sage: R.<x,y,z> = QQbar[]
sage: poly = x^3 + y^3 + z^3
sage: mr = poly.parent().quo(poly.jacobian_ideal()); mr
Quotient of Multivariate Polynomial Ring in x, y, z over Algebraic Field by the ideal (3*x^2, 3*y^2, 3*z^2)
sage: project = mr.cover()
verbose 0 (2416: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
This piece of code is repeated several times in a larger project, and all the warning messages are messing up the output. Is there a way to turn them off? (Yes, I do need to use QQbar, even though this example didn't use it.)
Thanks!shacsmugglerThu, 16 Jun 2011 15:26:38 +0200https://ask.sagemath.org/question/8166/