I'd just like to comment that, if the wording "nearest Mathematica equivalent" is going to be an essential part of this, then it should be very carefully chosen, and probably implemented through some function, so that typos are avoided.
e.g. def doc_equiv_command(sage_command, other_command, system): return <formatted string--you get the idea> but probably this has to be implemented using some ReST functionality that I don't know about. And to me it seems that "nearest" is a bad word here. Cases where sage/other system don't have easily comparable commands are likely to arise, and then different people will have different ideas of what "nearest" means. Discussion will ensue and slow everything down, when both good options should just be listed. Also, what if a particular sage function can be implemented in another system using two lines of code or so, but not less? At what point is it reasonable to declare "no equivalent function"? just my two (or three) cents, Niles On Sep 21, 12:22 pm, Nathann Cohen <nathann.co...@gmail.com> wrote: > Hello !!! > > > If it was possible to put the equivalent commands in the docstrings, and > > then use some code to extract them in a logical way, it would be helpful. > > > If it was done done in a very consistent way, then generating a list from > > grep and awk would be trivial: > > I like very long bash lines, with as many pipes as I can. I'm in :-D > > > Let's say one always had equivalent entries of the format: > > ... > > We would then search for lines where's there is a 6th entry too, as there > > might be two different commands needed in Mathematica, as there is for > > factor(). > > I totally agree on the idea. Now some details : if we finally put > these informations inside of the docstring then extract it from the > python files, it means these informations will be available in the > method's docstrings. So for example, it may be nice not to have to > repeat the command's name in those "equivalent" lines.. > > def method_name(): > r""" > ... > > EQUIVALENTS: > > method_name Mathematica MethodName[] > method_name Matlab MethodName[] > method_name Scilab MethodName[] > """ > ... > > This can be extracted from the line containing "def" just before the > r""" or the """. > > Then, because I am thinking of Graph Theory, it would be hard > sometimes to give, as you say, just one equivalent. Sometimes, many > are available, sometimes our Sage methods replace several Mathematica > methods at once because of our optional arguments. Sometimes, there is > no equivalent Mathematica method, but one doing "almost" the same job > : I remember having seen that Mathematica was only able to approximate > problems for which we had exact solvers, in which case we have to > explain in the "Equivalent" line the difference between the two. All > in all, I would quite love to be able to write a small paragraph > corresponding to an "Equivalent" line, to deal with all of it. > > What would you think of such a paragraph ? > > EQUIVALENTS: > > Mathematica : Small paragraph if necessary (and most probably on > multiple lines as we try to keep them short in the code), talking > about the differences between the current method and Method 1/2. (This > paragraph does not contain any list, as we want to be able to parse > the following commands easily ?) > > * Method 1 > * Method 2 > > Scilab : Same kind of things... > > * Method 1 > * Method 2 > > > Combining the two, we now have a complete list of Mathematica vs Sage > > commands, sorted by the Mathematica name. (We don't need to sort each time - > > only at the end) > > Hmmm... Actually, we would only have a Mathematica Vs Sage comparison > when we have a Sage method equivalent to the Mathematica one, or close > enough. The methods that Mathematica can handle while we can not do > not appear. Or perhaps those should just become TRAC tickets, and be > written :-D > > Nathann -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org