[sympy] making a class print using a printer

2013-06-02 Thread Lucas Wilkins
I have a class that does not extend a sympy object, but I would like it to print latex in the ipython shell (%load_ext sympyprinting), so I did something like class Thing: def _latex(self): return r"$\LaTeX$" I thought this should be enough, but it is not, what else is needed to get

Re: [sympy] making a class print using a printer

2013-06-02 Thread Aaron Meurer
The SymPy printing is not activated unless your class subclasses from Basic. If you won't want to do that, the best way to make your object print with LaTeX in the notebook is to just use the IPython machinery: class Test: def _repr_latex_(self): return r"$$\LaTeX$$" If all you want

Re: [sympy] atoms/xreplace idiom

2013-06-02 Thread Aaron Meurer
So I think the problem with using atoms is that the atoms change as the expression is replaced. xreplace is capable of doing this tranformation. For example, using Transform in sympy.core.rules In [7]: a = sin(sin(x) + y) + sin(z) In [8]: from sympy.core.rules import Transform In [11]: a.xrepl

Re: [sympy] making a class print using a printer

2013-06-02 Thread Lucas Wilkins
Cool, Thanks :) On Sunday, 2 June 2013 20:30:38 UTC+1, Aaron Meurer wrote: > > The SymPy printing is not activated unless your class subclasses from > Basic. If you won't want to do that, the best way to make your object > print with LaTeX in the notebook is to just use the IPython machinery:

[sympy] Matrices tutorial

2013-06-02 Thread Aaron Meurer
I'm writing the section of the new tutorial on matrices. What do people think are the most important methods, functions, and ideas to present? So far, I have - How to construct a matrix as a list of lists (should I also mention other constructors?) - Slicing. Should I mention any basic manipulati

Re: [sympy] Matrices tutorial

2013-06-02 Thread David Joyner
On Sun, Jun 2, 2013 at 9:40 PM, Aaron Meurer wrote: > I'm writing the section of the new tutorial on matrices. What do > people think are the most important methods, functions, and ideas to > present? So far, I have > > - How to construct a matrix as a list of lists (should I also mention > other

[sympy] Re: Matrices tutorial

2013-06-02 Thread Saurabh Jha
> - Should I mention sparse matrices? I think you can mention some basics of sparse matrices without causing any confusion. Is there any other reason why do you not want to include it? -Saurabh Jha -- You received this message because you are subscribed to the Google Groups "sympy" group. To u