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

Reply via email to