Opened 8 years ago

Last modified 4 years ago

#9957 new defect

Parametric Surfaces don't load well

Reported by: kcrisman Owned by: jason, was
Priority: minor Milestone: sage-6.4
Component: graphics Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by kcrisman)

See this ask.sagemath.org discussion for background.

sage: var('x,y')
(x, y)
sage: f(x,y)=x^2+y^2
sage: p=plot3d(f,(-5,5),(-5,5))
sage: p # works fine
sage: p.save('test.sobj')
sage: q = load('test.sobj')
sage: q
ERROR: An unexpected error occurred while tokenizing input
<snip>
NotImplementedError: You must override the get_grid method.

Change History (7)

comment:1 Changed 8 years ago by kcrisman

This can be traced down to the fact that in parametric_surface.pyx

    def get_grid(self, ds):
        """
        TEST::

            sage: from sage.plot.plot3d.parametric_surface import ParametricSurface
            sage: def f(x,y): return x+y,x-y,x*y
            sage: P = ParametricSurface(f)
            sage: P.get_grid(.1)
            Traceback (most recent call last):
            ...
            NotImplementedError: You must override the get_grid method.
        """
        if self.render_grid is None:
            raise NotImplementedError, "You must override the get_grid method."
        return self.render_grid

which is called from triangulate when you try to view the plot. For some reason the render_grid attribute isn't set in q, but in p it is. I don't know how to access these attributes, unfortunately...

comment:2 Changed 7 years ago by kcrisman

  • Description modified (diff)

comment:3 Changed 6 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:4 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:5 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:6 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:7 Changed 4 years ago by nbruin

Pickling is simply not implemented for this class:

sage: p.__reduce_ex__(2)
(<function copy_reg.__newobj__>,
 (sage.plot.plot3d.parametric_surface.ParametricSurface,),
 None,
 None,
 None)

as you can see, no construction parameters are provided at all. So this object just gets pickled as an empty ParametricSurface object.

Note: See TracTickets for help on using tickets.