#16996: IPython notebook with Sage Extensions
-------------------------------------+-------------------------------------
Reporter: vbraun | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.4
Component: interfaces | Resolution:
Keywords: | Merged in:
Authors: Volker Braun | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/vbraun/sage_ipynb | 95a4ea418c3eae890dc0ae4c50da4420ee0b10ab
Dependencies: #16746 | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by was):
Replying to [comment:11 vbraun]:
> 2d graphics works, 3d graphics will be displayed as 2d render. IMHO this
is good enough for a first stab at it.
>
> I've extended the magic `_graphics_()` method hook that we already had
in Sage so that you can specify a list of file formats that are acceptable
as output. The `_graphics_()` hook then can pick the best choice amongst
these possibilities. This works fine for the problem of finding a suitable
graphics file format.
>
> The same idea should be extended to text/html/latex output as well. The
user specifies which formats he wants (or his frontend can display), and
Sage then picks the best representation. I'll work on refactoring the
`_graphics_()` hook into a more general solution (probably called
`_repr_rich()`) on a followup ticket. Once we have this it would be easy
to make html/tex output work in a configurable way.
I'm glad you're working on this, since I've been meaning to do something
like this for Sage for a long time, since it is needed for
`SageMathCloud`. Unfortunately, I'm concerned that this approach will
cause me more trouble than help, at least for me. With `SageMathCloud` I
have to customize all of the outputs you mention above, and I think the
above approach (and what you've implemented in this patch), does not
provide a way for me to do it. I would have to directly edit the source
code of Sage, which I don't want to do (since it breaks people's custom
installs). Right now, SMC monkey patches *all* of the show methods,
except for 3d graphics, which can't be monkey patched, due to being in
Cython. The idea that "show" can be implemented by saving to a file
format, then calling some other function is insufficient, since in some
cases one wants to query an object in various ways as part of show. What
is really needed is a hook so that users can *replace* the show method
altogether at runtime if they want.
So if you can do all of the above, but *also* provide a hook for replacing
every show method by one of the user's choosing, especially supporting 3d
graphics which can't be monkey patched, then I'm on board.
--
Ticket URL: <http://trac.sagemath.org/ticket/16996#comment:12>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.