#10639: Graphics3dGroup `all` method can cause trouble if done individually
------------------------+---------------------------------------------------
Reporter: kcrisman | Owner: jason, was
Type: defect | Status: new
Priority: major | Milestone:
Component: graphics | Keywords: jmol graphics all
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------+---------------------------------------------------
`sage.plot.plot3d.base.Graphics3dGroup` is a disaster waiting to happen
from the command line, because some such graphics (naturally occurring)
have many, many components, and there is an attribute which opens a
separate Jmol for each one.
That is,
{{{
sage: x,y,z=var('x y z')
sage: plot_vector_field3d((x*cos(z),-y*cos(z),sin(z)), (x,0,pi), (y,0,pi),
(z,0,pi))
}}}
is fine, but
{{{
sage: P = plot_vector_field3d((x*cos(z),-y*cos(z),sin(z)), (x,0,pi),
(y,0,pi), (z,0,pi))
sage: P.all()
}}}
opens 125 new Jmol windows, as far as I can tell. Needless to say, this
makes doing anything at all - even closing those windows - nearly
impossible, even on a modern machine. Good thing I didn't use more plot
points!
A good test case is
{{{
sage: P = plot_vector_field3d((x*cos(z),-y*cos(z),sin(z)), (x,0,pi),
(y,0,pi), (z,0,pi),plot_points=2)
sage: P
sage: P.all
[, , , , , , , ]
}}}
The reason I consider this major is because it's not obvious how to access
the all the sub-pieces of a 3d plot, and someone might try this and get
very nasty results.
Hopefully, a simple fix to this can fix it. I'm actually surprised I can
access this internal attribute, when I often can't for other Sage
objects...
{{{
class Graphics3dGroup(Graphics3d):
"""
This class represents a collection of 3d objects. Usually they are
formed
implicitly by summing.
"""
def __init__(self, all=(), rot=None, trans=None, scale=None, T=None):
"""
<snip>
"""
self.all = list(all)
}}}
Another solution would be to change how 3D vector fields are implemented
and then make sure nothing has that many things in all, but that seems
less desirable.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10639>
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.