On Apr 30, 2011, at 4:03 PM, Ondrej Certik wrote: > On Fri, Apr 29, 2011 at 8:37 PM, Brian Granger <elliso...@gmail.com> wrote: >>> I am not sure I understand what your idea is, but it seems that's >>> exactly how I implemented it? TableForm is an object (it's not an >>> issue for me whether or not it is derived from Basic, currently it is >>> from technical reasons, but this can be changed), and then I have >>> enhanced the printers to be able to print TableForm nicely in all our >>> output printers. Because I want to use it with ascii (in terminal), in >>> latex (when I write articles, it would be so much easier to just >>> create the table in sympy, instead of wrestling with latex by hand), >>> html, and so on. >>> >>> Is there a better design for such a thing? >> >> In Mathematica, TableForm is not itself a data structure, but only >> something that takes a data structure and prints it in different > > Here is the definition: > > http://reference.wolfram.com/mathematica/ref/TableForm.html > > So the way I understand is, that it *is* a data structure, that holds > the data, and that can be printed in many formats, but maybe I am > wrong. In any case, I want to be able to do all of their examples.
Well, just because Mathematica does it this way, doesn't mean we have to also :) To me, the data structures and the printers should be separate, because that allows for the best modularity. So the underlying data structure should be some kind of two dimensional array, which then has printers, which can print using ascii, or rst, or latex, or whatever. Aaron Meurer > >> forms. Is this similar to your implementation? > > > As such, I have implemented TableForm as a Python class, that printers > know how to print. This allows me to replicate Mathematica examples. > If anyone has a better way to do it, patches/ideas welcome. :) > >> >>>> But I do think we want this type of functionality in sympy, especially >>>> something like TreeForm (I think that is what it is called) that >>>> displays a nice expression tree. >>> >>> Great, I agree. >> >> OK, Cool. I do think we want this in sympy as a table is an >> appropriate way of displaying symbolic expressions. If TableForm were > > +1 > >> focused more on displaying non-symbolic data, then I would say sympy >> is probably not the place for it. I can imagine numpy implmenting > > TableForm is for displaying any kinds of data, mainly including symbolic data. > >> something like this, but surely it won't be tied into sympy and handle >> all of our different printing formats. I am still +1 on this. > > Ondrej > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to sympy@googlegroups.com. > To unsubscribe from this group, send email to > sympy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.