Re: [sage-devel] Re: Please verify this apparently buggy behavior of dodecahedron() for me...
On Sun, Jan 18, 2015 at 5:44 PM, Volker Braun vbraun.n...@gmail.com wrote: I can confirm the bug. Note that the output of dodecahedron() is not a Polyhedron, its just a 3d graphics primitive: sage: type(dodecahedron()) type 'sage.plot.plot3d.index_face_set.IndexFaceSet' vs: sage: type(polytopes.dodecahedron()) class 'sage.geometry.polyhedron.backend_ppl.Polyhedra_QQ_ppl_with_category.element_class' IMHO the current dodecahedron should just be deleted, or at least removed from the global namespace. It's been there since 2008, along with the other standard regular polytopes, including cube, icosahedron, tetrahedron, etc. Removing it would break all code that uses it. Before removal, it would have to be deprecated and go through the year+ deprecation time. -- William On Monday, January 19, 2015 at 1:28:11 AM UTC+1, Jonathan wrote: sage: DD=dodecahedron() sage: print length of vertex list:+str(len(DD.vertex_list())) length of vertex list:20 sage: DD.show() sage: print length of vertex list:+str(len(DD.vertex_list())) length of vertex list:60 Somehow the show command is causing the verticies to be appended to the vertex_list two extra times. If others can verify, I will report a bug and we can start looking for this... I've seen this on multiple running cases of 6.4.rc1 and 6.4. Thanks, Jonathan -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout. -- William Stein Professor of Mathematics University of Washington http://wstein.org -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Re: Please verify this apparently buggy behavior of dodecahedron() for me...
On Sun, Jan 18, 2015 at 7:33 PM, William Stein wst...@gmail.com wrote: On Sun, Jan 18, 2015 at 6:44 PM, Jonathan gu...@uwosh.edu wrote: Yep, polytopes.blah().show(), is fine although I do not like the default green as much (It was chosen to differentiate it from the lines and vertices, I assume). Yes, I think this is as good or better. Should we put a ticket to simply make the regular solid calls go to polytope.blah.show(). I'm not sure how else they are being used. I also wonder if the vertex bug is hiding in these as well? Now, for the reason I encountered the bug...I was goofing around (I needed a break from reviewing proposals) trying to make my 3-D version of the logo (a few years back :) ) adaptable. It looks like most of what I want is available here. The problem is I never would have found them without the above pointers. ASIDE: if you start with geometry. or sage.geometry. and start working through tab completion I am not sure you would ever get to the construction polytopes.blah().show() for the regular solids. You don't get to the regular solids until sage.geometry.polyhedron.library.Polytopes.blah(). Why would I guess that I can shorten the call to polytopes.blah().show()? Why does polytopes (part of geometry) show up as a root level class? I'm beginning to think a committee needs to be tasked with restructuring the class hierarchy so that things can be found. Sagemath is actually quite wonderful, but it can be hard to find what you want. I would guess that most people find functionality in Sage by searching with google (or whatever, or even the search_doc function), not via tab completing little by little. I certainly would never consider trying to find anything that way. Instead of a committee to break all the code anybody ever wrote for Sage (which would be undesirable, akin to Python2 -- Python3), instead effort would be much better spent in making it easier to do a global search of the documentation and functionality. I'm sure that could be improved a lot. It would be interesting to hear ideas along those lines. As an exercise, try googling sage polyhedron plot https://www.google.com/webhp?sourceid=chrome-instantion=1espv=2ie=UTF-8#safe=offq=sage%20polyhedron%20plot The first hit, for me at least, is pretty useful. William Jonathan On Sunday, January 18, 2015 at 8:21:40 PM UTC-6, William wrote: On Sun, Jan 18, 2015 at 6:16 PM, William Stein wst...@gmail.com wrote: On Sun, Jan 18, 2015 at 6:03 PM, Jonathan gu...@uwosh.edu wrote: OK...I haven't checked yet, but I'll bet show on all the polyhedra primatives does something similar. Sort of, though it's significantly different than what the 3d plotting produces. polytopes.blah.show() makes a 3d graphic with edges and dots at vertices, etc... so it looks a lot different (maybe better). Re: Williams comment that we would have to deprecate it...could we effectively subsume it in the geometry types, while keeping the name and behavior? Yes, that should likely possible and would be very desirable. Do the polyhedra know about their symmetry? I don't think so -- they are just used for plotting. That would be a nice way of leading people to those tools? Yes, definitely. (NOTE: In case anybody tries, plotting of dodecahedrons in particular is currently broken/not implemented in SageMathCloud, since it involves polytopes defined by faces that have many vertices, and the renderer doesn't cover that case.) Jonathan On Sunday, January 18, 2015 at 7:44:25 PM UTC-6, Volker Braun wrote: I can confirm the bug. Note that the output of dodecahedron() is not a Polyhedron, its just a 3d graphics primitive: sage: type(dodecahedron()) type 'sage.plot.plot3d.index_face_set.IndexFaceSet' vs: sage: type(polytopes.dodecahedron()) class 'sage.geometry.polyhedron.backend_ppl.Polyhedra_QQ_ppl_with_category.element_class' IMHO the current dodecahedron should just be deleted, or at least removed from the global namespace. On Monday, January 19, 2015 at 1:28:11 AM UTC+1, Jonathan wrote: sage: DD=dodecahedron() sage: print length of vertex list:+str(len(DD.vertex_list())) length of vertex list:20 sage: DD.show() sage: print length of vertex list:+str(len(DD.vertex_list())) length of vertex list:60 Somehow the show command is causing the verticies to be appended to the vertex_list two extra times. If others can verify, I will report a bug and we can start looking for this... I've seen this on multiple running cases of 6.4.rc1 and 6.4. Thanks, Jonathan -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com. To post to this group, send email to sage-...@googlegroups.com. Visit this group
[sage-devel] Re: Please verify this apparently buggy behavior of dodecahedron() for me...
OK...I haven't checked yet, but I'll bet show on all the polyhedra primatives does something similar. Re: Williams comment that we would have to deprecate it...could we effectively subsume it in the geometry types, while keeping the name and behavior? Do the polyhedra know about their symmetry? That would be a nice way of leading people to those tools? Jonathan On Sunday, January 18, 2015 at 7:44:25 PM UTC-6, Volker Braun wrote: I can confirm the bug. Note that the output of dodecahedron() is not a Polyhedron, its just a 3d graphics primitive: sage: type(dodecahedron()) type 'sage.plot.plot3d.index_face_set.IndexFaceSet' vs: sage: type(polytopes.dodecahedron()) class 'sage.geometry.polyhedron.backend_ppl.Polyhedra_QQ_ppl_with_category.element_class' IMHO the current dodecahedron should just be deleted, or at least removed from the global namespace. On Monday, January 19, 2015 at 1:28:11 AM UTC+1, Jonathan wrote: sage: DD=dodecahedron() sage: print length of vertex list:+str(len(DD.vertex_list())) length of vertex list:20 sage: DD.show() sage: print length of vertex list:+str(len(DD.vertex_list())) length of vertex list:60 Somehow the show command is causing the verticies to be appended to the vertex_list two extra times. If others can verify, I will report a bug and we can start looking for this... I've seen this on multiple running cases of 6.4.rc1 and 6.4. Thanks, Jonathan -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Re: Please verify this apparently buggy behavior of dodecahedron() for me...
Yep, polytopes.blah().show(), is fine although I do not like the default green as much (It was chosen to differentiate it from the lines and vertices, I assume). Yes, I think this is as good or better. Should we put a ticket to simply make the regular solid calls go to polytope.blah.show(). I'm not sure how else they are being used. I also wonder if the vertex bug is hiding in these as well? Now, for the reason I encountered the bug...I was goofing around (I needed a break from reviewing proposals) trying to make my 3-D version of the logo (a few years back :) ) adaptable. It looks like most of what I want is available here. The problem is I never would have found them without the above pointers. ASIDE: if you start with geometry. or sage.geometry. and start working through tab completion I am not sure you would ever get to the construction polytopes.blah().show() for the regular solids. You don't get to the regular solids until sage.geometry.polyhedron.library.Polytopes.blah(). Why would I guess that I can shorten the call to polytopes.blah().show()? Why does polytopes (part of geometry) show up as a root level class? I'm beginning to think a committee needs to be tasked with restructuring the class hierarchy so that things can be found. Sagemath is actually quite wonderful, but it can be hard to find what you want. Jonathan On Sunday, January 18, 2015 at 8:21:40 PM UTC-6, William wrote: On Sun, Jan 18, 2015 at 6:16 PM, William Stein wst...@gmail.com javascript: wrote: On Sun, Jan 18, 2015 at 6:03 PM, Jonathan gu...@uwosh.edu javascript: wrote: OK...I haven't checked yet, but I'll bet show on all the polyhedra primatives does something similar. Sort of, though it's significantly different than what the 3d plotting produces. polytopes.blah.show() makes a 3d graphic with edges and dots at vertices, etc... so it looks a lot different (maybe better). Re: Williams comment that we would have to deprecate it...could we effectively subsume it in the geometry types, while keeping the name and behavior? Yes, that should likely possible and would be very desirable. Do the polyhedra know about their symmetry? I don't think so -- they are just used for plotting. That would be a nice way of leading people to those tools? Yes, definitely. (NOTE: In case anybody tries, plotting of dodecahedrons in particular is currently broken/not implemented in SageMathCloud, since it involves polytopes defined by faces that have many vertices, and the renderer doesn't cover that case.) Jonathan On Sunday, January 18, 2015 at 7:44:25 PM UTC-6, Volker Braun wrote: I can confirm the bug. Note that the output of dodecahedron() is not a Polyhedron, its just a 3d graphics primitive: sage: type(dodecahedron()) type 'sage.plot.plot3d.index_face_set.IndexFaceSet' vs: sage: type(polytopes.dodecahedron()) class 'sage.geometry.polyhedron.backend_ppl.Polyhedra_QQ_ppl_with_category.element_class' IMHO the current dodecahedron should just be deleted, or at least removed from the global namespace. On Monday, January 19, 2015 at 1:28:11 AM UTC+1, Jonathan wrote: sage: DD=dodecahedron() sage: print length of vertex list:+str(len(DD.vertex_list())) length of vertex list:20 sage: DD.show() sage: print length of vertex list:+str(len(DD.vertex_list())) length of vertex list:60 Somehow the show command is causing the verticies to be appended to the vertex_list two extra times. If others can verify, I will report a bug and we can start looking for this... I've seen this on multiple running cases of 6.4.rc1 and 6.4. Thanks, Jonathan -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com javascript:. To post to this group, send email to sage-...@googlegroups.com javascript:. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout. -- William Stein Professor of Mathematics University of Washington http://wstein.org -- William Stein Professor of Mathematics University of Washington http://wstein.org -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
[sage-devel] Re: Please verify this apparently buggy behavior of dodecahedron() for me...
On 2015-01-19, Jonathan gu...@uwosh.edu wrote: sage: DD=dodecahedron() sage: print length of vertex list:+str(len(DD.vertex_list())) length of vertex list:20 sage: DD.show() sage: print length of vertex list:+str(len(DD.vertex_list())) length of vertex list:60 Somehow the show command is causing the verticies to be appended to the vertex_list two extra times. If others can verify, I will report a bug and we can start looking for this... I've seen this on multiple running cases of 6.4.rc1 and 6.4. I can confirm this on 6.5.beta5 Dima Thanks, Jonathan -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Re: Please verify this apparently buggy behavior of dodecahedron() for me...
On Sun, Jan 18, 2015 at 6:44 PM, Jonathan gu...@uwosh.edu wrote: Yep, polytopes.blah().show(), is fine although I do not like the default green as much (It was chosen to differentiate it from the lines and vertices, I assume). Yes, I think this is as good or better. Should we put a ticket to simply make the regular solid calls go to polytope.blah.show(). I'm not sure how else they are being used. I also wonder if the vertex bug is hiding in these as well? Now, for the reason I encountered the bug...I was goofing around (I needed a break from reviewing proposals) trying to make my 3-D version of the logo (a few years back :) ) adaptable. It looks like most of what I want is available here. The problem is I never would have found them without the above pointers. ASIDE: if you start with geometry. or sage.geometry. and start working through tab completion I am not sure you would ever get to the construction polytopes.blah().show() for the regular solids. You don't get to the regular solids until sage.geometry.polyhedron.library.Polytopes.blah(). Why would I guess that I can shorten the call to polytopes.blah().show()? Why does polytopes (part of geometry) show up as a root level class? I'm beginning to think a committee needs to be tasked with restructuring the class hierarchy so that things can be found. Sagemath is actually quite wonderful, but it can be hard to find what you want. I would guess that most people find functionality in Sage by searching with google (or whatever, or even the search_doc function), not via tab completing little by little. I certainly would never consider trying to find anything that way. Instead of a committee to break all the code anybody ever wrote for Sage (which would be undesirable, akin to Python2 -- Python3), instead effort would be much better spent in making it easier to do a global search of the documentation and functionality. I'm sure that could be improved a lot. It would be interesting to hear ideas along those lines. Anyway, I'm generally on principle against changing things about the sage library that breaks existing code, except fixing bugs, since I care a lot about users. -- William Jonathan On Sunday, January 18, 2015 at 8:21:40 PM UTC-6, William wrote: On Sun, Jan 18, 2015 at 6:16 PM, William Stein wst...@gmail.com wrote: On Sun, Jan 18, 2015 at 6:03 PM, Jonathan gu...@uwosh.edu wrote: OK...I haven't checked yet, but I'll bet show on all the polyhedra primatives does something similar. Sort of, though it's significantly different than what the 3d plotting produces. polytopes.blah.show() makes a 3d graphic with edges and dots at vertices, etc... so it looks a lot different (maybe better). Re: Williams comment that we would have to deprecate it...could we effectively subsume it in the geometry types, while keeping the name and behavior? Yes, that should likely possible and would be very desirable. Do the polyhedra know about their symmetry? I don't think so -- they are just used for plotting. That would be a nice way of leading people to those tools? Yes, definitely. (NOTE: In case anybody tries, plotting of dodecahedrons in particular is currently broken/not implemented in SageMathCloud, since it involves polytopes defined by faces that have many vertices, and the renderer doesn't cover that case.) Jonathan On Sunday, January 18, 2015 at 7:44:25 PM UTC-6, Volker Braun wrote: I can confirm the bug. Note that the output of dodecahedron() is not a Polyhedron, its just a 3d graphics primitive: sage: type(dodecahedron()) type 'sage.plot.plot3d.index_face_set.IndexFaceSet' vs: sage: type(polytopes.dodecahedron()) class 'sage.geometry.polyhedron.backend_ppl.Polyhedra_QQ_ppl_with_category.element_class' IMHO the current dodecahedron should just be deleted, or at least removed from the global namespace. On Monday, January 19, 2015 at 1:28:11 AM UTC+1, Jonathan wrote: sage: DD=dodecahedron() sage: print length of vertex list:+str(len(DD.vertex_list())) length of vertex list:20 sage: DD.show() sage: print length of vertex list:+str(len(DD.vertex_list())) length of vertex list:60 Somehow the show command is causing the verticies to be appended to the vertex_list two extra times. If others can verify, I will report a bug and we can start looking for this... I've seen this on multiple running cases of 6.4.rc1 and 6.4. Thanks, Jonathan -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com. To post to this group, send email to sage-...@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout. -- William
Re: [sage-devel] Re: Exit status of Sage
Nice catch! Alternatively: * use a .py extension (that way there will not be any preparsing) * write sys.exit(int(42r)) You mean sys.exit(42r) (42r is the raw Python integer 42, so you don't need to apply int to it). : ) -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Re: Please verify this apparently buggy behavior of dodecahedron() for me...
On Sun, Jan 18, 2015 at 6:03 PM, Jonathan gu...@uwosh.edu wrote: OK...I haven't checked yet, but I'll bet show on all the polyhedra primatives does something similar. Sort of, though it's significantly different than what the 3d plotting produces. polytopes.blah.show() makes a 3d graphic with edges and dots at vertices, etc... so it looks a lot different (maybe better). Re: Williams comment that we would have to deprecate it...could we effectively subsume it in the geometry types, while keeping the name and behavior? Yes, that should likely possible and would be very desirable. Do the polyhedra know about their symmetry? I don't think so -- they are just used for plotting. That would be a nice way of leading people to those tools? Yes, definitely. (NOTE: In case anybody tries, plotting of dodecahedrons in particular is currently broken/not implemented in SageMathCloud, since it involves polytopes defined by faces that have many vertices, and the renderer doesn't cover that case.) Jonathan On Sunday, January 18, 2015 at 7:44:25 PM UTC-6, Volker Braun wrote: I can confirm the bug. Note that the output of dodecahedron() is not a Polyhedron, its just a 3d graphics primitive: sage: type(dodecahedron()) type 'sage.plot.plot3d.index_face_set.IndexFaceSet' vs: sage: type(polytopes.dodecahedron()) class 'sage.geometry.polyhedron.backend_ppl.Polyhedra_QQ_ppl_with_category.element_class' IMHO the current dodecahedron should just be deleted, or at least removed from the global namespace. On Monday, January 19, 2015 at 1:28:11 AM UTC+1, Jonathan wrote: sage: DD=dodecahedron() sage: print length of vertex list:+str(len(DD.vertex_list())) length of vertex list:20 sage: DD.show() sage: print length of vertex list:+str(len(DD.vertex_list())) length of vertex list:60 Somehow the show command is causing the verticies to be appended to the vertex_list two extra times. If others can verify, I will report a bug and we can start looking for this... I've seen this on multiple running cases of 6.4.rc1 and 6.4. Thanks, Jonathan -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout. -- William Stein Professor of Mathematics University of Washington http://wstein.org -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
[sage-devel] Re: Please verify this apparently buggy behavior of dodecahedron() for me...
I can confirm the bug. Note that the output of dodecahedron() is not a Polyhedron, its just a 3d graphics primitive: sage: type(dodecahedron()) type 'sage.plot.plot3d.index_face_set.IndexFaceSet' vs: sage: type(polytopes.dodecahedron()) class 'sage.geometry.polyhedron.backend_ppl.Polyhedra_QQ_ppl_with_category.element_class' IMHO the current dodecahedron should just be deleted, or at least removed from the global namespace. On Monday, January 19, 2015 at 1:28:11 AM UTC+1, Jonathan wrote: sage: DD=dodecahedron() sage: print length of vertex list:+str(len(DD.vertex_list())) length of vertex list:20 sage: DD.show() sage: print length of vertex list:+str(len(DD.vertex_list())) length of vertex list:60 Somehow the show command is causing the verticies to be appended to the vertex_list two extra times. If others can verify, I will report a bug and we can start looking for this... I've seen this on multiple running cases of 6.4.rc1 and 6.4. Thanks, Jonathan -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] The fastest way to expand((a1+a2+a3+a4+sqrt(3)*a5)^25)
Your example can be reduced to polynomials sage: K.sqrt3 = QuadraticField(3) sage: R.a1,a2,a3,a4,a5 = K[] sage: timeit((a1+a2+a3+a4+sqrt3*a5)^25) 5 loops, best of 3: 81 ms per loop (And just for completeness, the symbolic expansion on my laptop took 4.54s) Vincent 2015-01-18 7:26 UTC+01:00, Ondřej Čertík ondrej.cer...@gmail.com: Hi, I was wondering what the fastest way is to do this benchmark in Sage: ┌┐ │ Sage Version 6.4, Release Date: 2014-11-14 │ │ Enhanced for SageMathCloud.│ └┘ sage: var('a1 a2 a3 a4 a5 a6 a7') (a1, a2, a3, a4, a5, a6, a7) sage: time f = expand((a1+a2+a3+a4+sqrt(3)*a5)^25) CPU times: user 9.02 s, sys: 281 ms, total: 9.3 s Wall time: 8.91 s sage: len(f.operands()) 23751 I took the Expanding a Symbolic Expression from http://www.sagemath.org/tour-benchmarks.html, but made it shorter and added sqrt(3) in there. I tried to use the polynomials way, i.e. R.a1,a2,a3,a4,a5,a6,a7 = QQ[], but that didn't expand it at all. The above is using SMC. On my slow laptop, using our CSymPy library (https://github.com/sympy/csympy), written in C++, I get: In [4]: time f = ((a1+a2+a3+a4+sqrt(3)*a5)**25).expand() CPU times: user 201 ms, sys: 23.9 ms, total: 225 ms Wall time: 226 ms In [5]: len(f.args) Out[5]: 23751 Which is almost 40x faster. Essentially I am wondering, if there is any software in Sage that can do this faster. In other words, whether this is a good benchmark to test general symbolic manipulation, that cannot be trivially converted to a polynomial manipulation (for which there are great libraries out there, that one should just call). Ondrej -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
[sage-devel] Please verify this apparently buggy behavior of dodecahedron() for me...
sage: DD=dodecahedron() sage: print length of vertex list:+str(len(DD.vertex_list())) length of vertex list:20 sage: DD.show() sage: print length of vertex list:+str(len(DD.vertex_list())) length of vertex list:60 Somehow the show command is causing the verticies to be appended to the vertex_list two extra times. If others can verify, I will report a bug and we can start looking for this... I've seen this on multiple running cases of 6.4.rc1 and 6.4. Thanks, Jonathan -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Re: inherit group from monoid
Hi Robert, On Tue, Jan 13, 2015 at 06:11:09PM -0800, Robert Bradshaw wrote: :). It might be possible, but it'd be really, really messy (messier than it is in C++, because one needs the shared PyObject_HEAD to be correctly accessed by all the Python C API framework). Didn't you mention at some point that, for purely abstract classes (like those from categories), this would be not so bad? Cheers, Nicolas -- Nicolas M. Thiéry Isil nthi...@users.sf.net http://Nicolas.Thiery.name/ -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Re: Exit status of Sage
On Sun, Jan 18, 2015 at 5:02 PM, Dima Pasechnik dimp...@gmail.com wrote: On 2015-01-18, Jernej Azarija azi.std...@gmail.com wrote: The thing is that sys.exit works pretty much the same way azi@goodegg:~$ cat foo.sage import sys sys.exit(42) azi@goodegg:~$ sage foo.sage 42 azi@goodegg:~$ echo $? 1 And the print itself is extremely annoying. I need to call Sage 10^6 times from an external program and get 10^6 lines of non-needed output. this looks pretty bad, given that Sage's startup+exit time is 1 or 2 seconds on a reasoably fast computer. (unless your computations are still much slower, of course). There should be ways to communicate with Sage without quitting in. I agree. I ended up writing the output to a file and parsing it within the caller. Still pretty ugly and inefficient but it works. Though this still does not answer the question - why is Sage printing the exit status and not conforming to the standard behaviour of unix programs? On Sat, Jan 17, 2015 at 11:24 PM, Robert Bradshaw rober...@math.washington.edu wrote: On Sat, Jan 17, 2015 at 2:02 PM, John H Palmieri jhpalmier...@gmail.com wrote: On Saturday, January 17, 2015 at 10:28:22 AM UTC-8, Jernej Azarija wrote: Hello, I have to use Sage from an external comand and in order to do so I'll need to rely on the exit status given by Sage. Considering a trivial example = $ cat foo.sage exit(0) = I get the following behaviour = $ sage la.sage 0 $ echo $? 1 = There are two things I am confused with here. 1. Why do we print 0? 2. Why is the exit status 1 - indicating an error by UNIX standards? Is there any reason behind this? If yes , what would be the best way to force my own exit status so that I can interpret the execution of Sage from an external program? The underlying problem is that the exit function in Python doesn't accept any arguments, so exit(0) raises an error when you run it in Sage. This is why the exit status is nonzero. If your script had the line exit(), it would run as expected. Given that, I'm not sure why it prints 0. If you do exit(3), it will print 3 instead. You probably want sys.exit, which does take an exit status as an integer. -- You received this message because you are subscribed to a topic in the Google Groups sage-devel group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-devel/CriQpiwWRLA/unsubscribe. To unsubscribe from this group and all its topics, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to a topic in the Google Groups sage-devel group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-devel/CriQpiwWRLA/unsubscribe. To unsubscribe from this group and all its topics, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
[sage-devel] Re: Exit status of Sage
On 2015-01-18, Jernej Azarija azi.std...@gmail.com wrote: The thing is that sys.exit works pretty much the same way azi@goodegg:~$ cat foo.sage import sys sys.exit(42) azi@goodegg:~$ sage foo.sage 42 azi@goodegg:~$ echo $? 1 And the print itself is extremely annoying. I need to call Sage 10^6 times from an external program and get 10^6 lines of non-needed output. this looks pretty bad, given that Sage's startup+exit time is 1 or 2 seconds on a reasoably fast computer. (unless your computations are still much slower, of course). There should be ways to communicate with Sage without quitting in. On Sat, Jan 17, 2015 at 11:24 PM, Robert Bradshaw rober...@math.washington.edu wrote: On Sat, Jan 17, 2015 at 2:02 PM, John H Palmieri jhpalmier...@gmail.com wrote: On Saturday, January 17, 2015 at 10:28:22 AM UTC-8, Jernej Azarija wrote: Hello, I have to use Sage from an external comand and in order to do so I'll need to rely on the exit status given by Sage. Considering a trivial example = $ cat foo.sage exit(0) = I get the following behaviour = $ sage la.sage 0 $ echo $? 1 = There are two things I am confused with here. 1. Why do we print 0? 2. Why is the exit status 1 - indicating an error by UNIX standards? Is there any reason behind this? If yes , what would be the best way to force my own exit status so that I can interpret the execution of Sage from an external program? The underlying problem is that the exit function in Python doesn't accept any arguments, so exit(0) raises an error when you run it in Sage. This is why the exit status is nonzero. If your script had the line exit(), it would run as expected. Given that, I'm not sure why it prints 0. If you do exit(3), it will print 3 instead. You probably want sys.exit, which does take an exit status as an integer. -- You received this message because you are subscribed to a topic in the Google Groups sage-devel group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-devel/CriQpiwWRLA/unsubscribe. To unsubscribe from this group and all its topics, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Re: Exit status of Sage
The thing is that sys.exit works pretty much the same way azi@goodegg:~$ cat foo.sage import sys sys.exit(42) azi@goodegg:~$ sage foo.sage 42 azi@goodegg:~$ echo $? 1 And the print itself is extremely annoying. I need to call Sage 10^6 times from an external program and get 10^6 lines of non-needed output. On Sat, Jan 17, 2015 at 11:24 PM, Robert Bradshaw rober...@math.washington.edu wrote: On Sat, Jan 17, 2015 at 2:02 PM, John H Palmieri jhpalmier...@gmail.com wrote: On Saturday, January 17, 2015 at 10:28:22 AM UTC-8, Jernej Azarija wrote: Hello, I have to use Sage from an external comand and in order to do so I'll need to rely on the exit status given by Sage. Considering a trivial example = $ cat foo.sage exit(0) = I get the following behaviour = $ sage la.sage 0 $ echo $? 1 = There are two things I am confused with here. 1. Why do we print 0? 2. Why is the exit status 1 - indicating an error by UNIX standards? Is there any reason behind this? If yes , what would be the best way to force my own exit status so that I can interpret the execution of Sage from an external program? The underlying problem is that the exit function in Python doesn't accept any arguments, so exit(0) raises an error when you run it in Sage. This is why the exit status is nonzero. If your script had the line exit(), it would run as expected. Given that, I'm not sure why it prints 0. If you do exit(3), it will print 3 instead. You probably want sys.exit, which does take an exit status as an integer. -- You received this message because you are subscribed to a topic in the Google Groups sage-devel group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-devel/CriQpiwWRLA/unsubscribe. To unsubscribe from this group and all its topics, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Re: Exit status of Sage
On Sunday, January 18, 2015 at 8:09:00 AM UTC-8, Jernej Azarija wrote: On Sun, Jan 18, 2015 at 5:02 PM, Dima Pasechnik dim...@gmail.com javascript: wrote: On 2015-01-18, Jernej Azarija azi.s...@gmail.com javascript: wrote: The thing is that sys.exit works pretty much the same way azi@goodegg:~$ cat foo.sage import sys sys.exit(42) azi@goodegg:~$ sage foo.sage 42 azi@goodegg:~$ echo $? 1 And the print itself is extremely annoying. I need to call Sage 10^6 times from an external program and get 10^6 lines of non-needed output. this looks pretty bad, given that Sage's startup+exit time is 1 or 2 seconds on a reasoably fast computer. (unless your computations are still much slower, of course). There should be ways to communicate with Sage without quitting in. I agree. I ended up writing the output to a file and parsing it within the caller. Still pretty ugly and inefficient but it works. Though this still does not answer the question - why is Sage printing the exit status and not conforming to the standard behaviour of unix programs? Oh, I see: it's the preparsing. When you do sys.exit(42), the number 42 is a Sage integer, not a Python integer. So sys.exit doesn't know what to do with it. (I still don't know why that causes the number to be printed.) So use sys.exit(int(42)) instead. -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] The fastest way to expand((a1+a2+a3+a4+sqrt(3)*a5)^25)
Hi, 2015-01-18 18:03 UTC+01:00, Ondřej Čertík ondrej.cer...@gmail.com: Can you invent an example, that can't be converted to polynomials? Perhaps (a1+a2+a3+sqrt(5)*a4+sqrt(3)*a5)^25? Still doable. You need to involve log, exp, cos or similar transcendental functions. Vincent -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] The fastest way to expand((a1+a2+a3+a4+sqrt(3)*a5)^25)
Hi Vincent, On Sun, Jan 18, 2015 at 1:18 AM, Vincent Delecroix 20100.delecr...@gmail.com wrote: Your example can be reduced to polynomials sage: K.sqrt3 = QuadraticField(3) sage: R.a1,a2,a3,a4,a5 = K[] sage: timeit((a1+a2+a3+a4+sqrt3*a5)^25) 5 loops, best of 3: 81 ms per loop That's cool, I wasn't aware you can do that. Thanks. Can you invent an example, that can't be converted to polynomials? Perhaps (a1+a2+a3+sqrt(5)*a4+sqrt(3)*a5)^25? Ondrej -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Re: Exit status of Sage
2015-01-18 17:32 UTC+01:00, John H Palmieri jhpalmier...@gmail.com: Oh, I see: it's the preparsing. When you do sys.exit(42), the number 42 is a Sage integer, not a Python integer. So sys.exit doesn't know what to do with it. (I still don't know why that causes the number to be printed.) So use sys.exit(int(42)) instead. Nice catch! Alternatively: * use a .py extension (that way there will not be any preparsing) * write sys.exit(int(42r)) Vincent -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.