arokem / python-matlab-bridge

A simple Python => MATLAB(R) interface and a matlab_magic for ipython
BSD 2-Clause "Simplified" License
335 stars 96 forks source link

IMatlab — an IPython profile for exclusively Matlab code #34

Closed mbauman closed 9 years ago

mbauman commented 10 years ago

I have not spent any time looking into this yet, so I have no idea how feasible it may be with your current design (perhaps it should be a different project entirely).

But I love working within IPython. And I'd love to be able to use full Matlab syntax (@ anonymous functions, % comments, etc), with real Matlab-style syntax highlighting. Could your project possibly be extended to add a profile for a Matlab backend to IPython? I'm imagining something similar to IJulia.

This issue is just to test the waters for this approach. Feel free to close if you think this is out of scope for this project.

arokem commented 10 years ago

Thanks for the feedback. Something like IJulia - a kernel for the notebook written in matlab - would require a lot more work and is on our radar, but not for the immediate future. It might need to be a separate project. There's some detailed explanation here: http://andrew.gibiansky.com/blog/ipython/ipython-kernels/, about what that would entail.

Our current focus is making the bridge between python and Matlab more robust and performant.

Still - what you describe - an ipython notebook that only runs Matlab code (through the pymatbridge), and properly highlights matlab syntax, etc. should be possible, with some work, and is on our mid-range todo list. Ideally, we would have an ipython profile that, upon startup, starts pymatbridge and invisibly auto-decorates every cell with the %%matlab. This notebook would also render using the octave/matlab mode of codemirror ( http://codemirror.net/mode/octave/index.html), instead of the python codemirror mode that is currently picked up by the notebook. It would look just like a native Matlab notebook, but would still have the bridge interposing between the two languages.

How does that sound? Any interest in working on making that a reality? Pull requests most welcome! ;-)

On Mon, Jan 13, 2014 at 9:18 AM, Matt Bauman notifications@github.comwrote:

I have not spent any time looking into this yet, so I have no idea how feasible it may be with your current design (perhaps it should be a different project entirely).

But I love working within IPython. And I'd love to be able to use full Matlab syntax (@ anonymous functions, % comments, etc), with real Matlab-style syntax highlighting. Could your project possibly be extended to add a profile for a Matlab backend to IPython? I'm imagining something similar to IJulia https://github.com/JuliaLang/IJulia.jl.

This issue is just to test the waters for this approach. Feel free to close if you think this is out of scope for this project.

— Reply to this email directly or view it on GitHubhttps://github.com/arokem/python-matlab-bridge/issues/34 .

mbauman commented 10 years ago

Thanks for the feedback and the pointer to Andrew's blog post. My plate is pretty full at the moment, but I think this would be a wonderful thing to have… perhaps I'll manage to find some spare time to hack on it.

bilderbuchi commented 9 years ago

FWIW, Octave and Matlab Ipython seem to have been created in the meantime.

arokem commented 9 years ago

Yes. Since that issue was raised we've implemented the Matlab IPython magic. The Matlab kernel you mentioned actually relies on pymatbridge to communicate between IPython and Matlab.

On Tue, Jul 14, 2015 at 4:02 AM, Christoph Buchner <notifications@github.com

wrote:

FWIW, Octave https://github.com/calysto/octave_kernel and Matlab https://github.com/calysto/matlab_kernel Ipython seem to have been created in the meantime.

— Reply to this email directly or view it on GitHub https://github.com/arokem/python-matlab-bridge/issues/34#issuecomment-121201836 .

mbauman commented 9 years ago

Very cool. Thanks for the update!