Eric Schug | 1 Feb 02:06
Picon

Automating Matlab

Is there strong interest in automating matlab to numpy conversion?

I have a working version of a matlab to python translator.
It allows translation of matlab scripts into numpy constructs, 
supporting most of the matlab language.  The parser is nearly complete.  
Most of the remaining work involves providing a robust translation. Such as
    * making sure that copies on assign are done when needed.
    * correct indexing a(:) becomes a.flatten(1) when on the left hand 
side (lhs) of equals
       and a[:] when on the right hand side

I've seen a few projects attempt to do this, but for one reason or 
another have stopped it.
Robert Kern | 1 Feb 02:34
Picon
Gravatar

Re: Automating Matlab

On Sat, Jan 31, 2009 at 19:06, Eric Schug <schugschug <at> gmail.com> wrote:
> Is there strong interest in automating matlab to numpy conversion?

Yes! Please post your code somewhere!

--

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco
David Warde-Farley | 1 Feb 02:49
Picon
Favicon
Gravatar

Re: Automating Matlab

On 31-Jan-09, at 8:06 PM, Eric Schug wrote:

> Is there strong interest in automating matlab to numpy conversion?

I think there is a strong interest in this. One of the main obstacles  
to changing environments is inertia and familiarity. My advisor  
repeatedly expresses his wish to give Python another try, and having  
an easy way to show him how his existing scripts translate would be  
awesome.

Of course there are caveats, corner cases where such translations will  
fail, but a fairly foolproof method of converting simple scripts would  
be just fantastic. I imagine if you've gotten further along than  
previous attempts you'll receive a lot of street cred on this list and  
probably a lot of patches to make things work better. :)

David
Gideon Simpson | 1 Feb 06:37
Picon
Favicon

shared memory machines

Has anyone been able to take advantage of shared memory machines with  
scipy?  How did you do it?

-gideon
Young, Karl | 1 Feb 06:45
Picon
Favicon

Re: Automating Matlab


>> Is there strong interest in automating matlab to numpy conversion?

> Yes! Please post your code somewhere!

seconded !!!!! I'm currently working on a grant that has turned out to involve porting a lot of matlab code to
python; you will be gratefully acknowledged in whatever comes of the work of the grant.

-- KY 
gsever | 1 Feb 08:49
Picon
Gravatar

Re: Automating Matlab

I am interested with this project, too. Would be much better to have
an automated tool than doing manual conversations.

Just for your information, there is a IDL-to-Python conversation tool
named i2py @ http://code.google.com/p/i2py/

On Jan 31, 7:06 pm, Eric Schug <schugsc...@gmail.com> wrote:
> Is there strong interest in automating matlab to numpy conversion?
>
> I have a working version of a matlab to python translator.
> It allows translation of matlab scripts into numpy constructs,
> supporting most of the matlab language.  The parser is nearly complete.  
> Most of the remaining work involves providing a robust translation. Such as
>     * making sure that copies on assign are done when needed.
>     * correct indexing a(:) becomes a.flatten(1) when on the left hand
> side (lhs) of equals
>        and a[:] when on the right hand side
>
> I've seen a few projects attempt to do this, but for one reason or
> another have stopped it.
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-u...@scipy.orghttp://projects.scipy.org/mailman/listinfo/scipy-user
Stef Mientki | 1 Feb 10:27
Picon
Favicon
Gravatar

Re: Automating Matlab


Robert Kern wrote:
> On Sat, Jan 31, 2009 at 19:06, Eric Schug <schugschug <at> gmail.com> wrote:
>   
>> Is there strong interest in automating matlab to numpy conversion?
>>     
>
> Yes! Please post your code somewhere!
>
>   
+1

And this is a very good moment for the persons who are creating a Matlab 
like environment,
including the Matlab-like workspace,
to show there creations.

cheers,
Stef
Gael Varoquaux | 1 Feb 10:57
Favicon
Gravatar

Re: shared memory machines

On Sun, Feb 01, 2009 at 12:37:48AM -0500, Gideon Simpson wrote:
> Has anyone been able to take advantage of shared memory machines with  
> scipy?  How did you do it?

I am not sure I understand your question. You want to do parallel
computing and share the arrays between processes, is that it?

Gaël
Gideon Simpson | 1 Feb 16:03
Picon
Favicon

Re: shared memory machines

Yes, but I'm talking about when you have a multiprocessor/multicore  
system, not a commodity cluster.  In these shared memory  
configurations, were I using compiled code, I'd be able to use OpenMP  
to take advantage of the additional cores/processors.  I'm wondering  
if anyone has looked at ways to take advantage of such configurations  
with scipy.

-gideon

On Feb 1, 2009, at 4:57 AM, Gael Varoquaux wrote:

> On Sun, Feb 01, 2009 at 12:37:48AM -0500, Gideon Simpson wrote:
>> Has anyone been able to take advantage of shared memory machines with
>> scipy?  How did you do it?
>
> I am not sure I understand your question. You want to do parallel
> computing and share the arrays between processes, is that it?
>
> Gaël
> _______________________________________________
> SciPy-user mailing list
> SciPy-user <at> scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
Gael Varoquaux | 1 Feb 16:29
Favicon
Gravatar

Re: shared memory machines

On Sun, Feb 01, 2009 at 10:03:30AM -0500, Gideon Simpson wrote:
> Yes, but I'm talking about when you have a multiprocessor/multicore  
> system, not a commodity cluster.  In these shared memory  
> configurations, were I using compiled code, I'd be able to use OpenMP  
> to take advantage of the additional cores/processors.  I'm wondering  
> if anyone has looked at ways to take advantage of such configurations  
> with scipy.

I use the multiprocessing module:
http://docs.python.org/library/multiprocessing.html

I also have some code to share arrays between processes. I'd love to
submit it for integration with numpy, but first I'd like it to get more
exposure so that the eventual flaws in the APIs are found. I am attaching
it.

Actually I wrote this code a few months ago, and now that I am looking at
it, I realise that the SharedMemArray should probably be a subclass of
numpy.ndarray, and implement the full array signature. I am not sure if
this is possible or not (ie if it will still be easy to have
multiprocessing share the data between processes or not). I don't really
have time for polishing this right, anybody wants to have a go?

Gaël

> On Feb 1, 2009, at 4:57 AM, Gael Varoquaux wrote:

> > On Sun, Feb 01, 2009 at 12:37:48AM -0500, Gideon Simpson wrote:
> >> Has anyone been able to take advantage of shared memory machines with
> >> scipy?  How did you do it?
(Continue reading)


Gmane