[SciPy-user] Automatic MATLAB to scipy/numpy/pylab conversion
Wed Jul 9 10:28:15 CDT 2008
Unfortunately, basic "for" loop syntax and "end" statements are just
the tip of the iceberg in terms of conversion issues. Even if you had
a reasonable way to fix those, I think you'll find it much harder to
automatically convert array syntax. Least of which is indices starting
at 0, not 1. That can really change the presentation of an algorithm
in subtle ways.
I'm no expert in writing parsers, etc., but you might learn something
about what's necessary to convert from matlab by looking at the python
2to3 tool that is intended to help users automatically upgrade their
code from the python version 2.x series to python 3000. This is fairly
complex stuff, making use of a formal python grammar in an abstract
syntax tree. I suspect you won't achieve a reliable conversion of
matlab scripts without a similarly sophisticated approach, which would
be a lot of work for you.
Given your success with your colleagues so far, I'd suggest you keep
diligently working on the psychological angle until they make the
effort themselves to discover how easy it is to learn python. Maybe
dangle them a carrot, such as a proper object-oriented example
relevant to your work to show off what they are missing...
On Wed, Jul 9, 2008 at 10:29 AM, anirudh vij <email@example.com> wrote:
> On Wed, Jul 9, 2008 at 4:13 PM, Ivo Maljevic <firstname.lastname@example.org> wrote:
>> If they are matlab experts than maybe it will be enough to give them the
>> matlab-python cross reference:
> Mathersaurus is great for guys creating new python code(where they can
> use the cross-reference).
> But conversion of legacy matlab code (which i have to do,
> unfortunately) is still an issue. A python script could perhaps help
> with that. I dont know whether such a script is better called a
> preprocessor or a converter.
> SciPy-user mailing list
More information about the SciPy-user