Discussion:
[julia-users] Running octave scrips from julia
astromono
2015-02-06 19:03:23 UTC
Permalink
Hi all,
I am getting to julia in recent months. I have hundreds (thousands,
perhaps) of functions and scrips in octave (many years working with matlab
/octave). I'm linux user (LMDE).
The fact is that from python I use oct2py module to run octave functions
with reasonably good results.
But in julia, using PyCall, this fails.
To begin "@pyimport oct2py.octave as oc" leaves locked the command until you
cancel it:

julia>pyimport oct2py.octave as oc


^ CERROR: function is not yet c-callable
in pyinitialize at /home/rober/.julia/v0.4/PyCall/src/pyinit.jl:245
in pyinitialize at /home/rober/.julia/v0.4/PyCall/src/pyinit.jl:305
in pyimport at /home/rober/.julia/v0.4/PyCall/src/PyCall.jl:111

Is there any way to run octave commands and functions from julia?

thank you in advance

Hugs,
Rober
Viral Shah
2015-02-06 19:29:18 UTC
Permalink
I really think that for something like this to work reliably, we probably
want a way to call octave directly from Julia, but that requires some
effort. Sorry - I don't have anything useful to add for the PyCall route. I
guess that even though convoluted, it would be nice if it worked.

-viral
Post by astromono
Hi all,
I am getting to julia in recent months. I have hundreds
(thousands, perhaps) of functions and scrips in octave (many years
working with matlab/octave). I'm linux user (LMDE).
The fact is that from python I use oct2py module to run octave functions
with reasonably good results.
But in julia, using PyCall, this fails.
julia>pyimport oct2py.octave as oc
^ CERROR: function is not yet c-callable
in pyinitialize at /home/rober/.julia/v0.4/PyCall/src/pyinit.jl:245
in pyinitialize at /home/rober/.julia/v0.4/PyCall/src/pyinit.jl:305
in pyimport at /home/rober/.julia/v0.4/PyCall/src/PyCall.jl:111
Is there any way to run octave commands and functions from julia?
thank you in advance
Hugs,
Rober
Steven G. Johnson
2015-02-06 21:40:17 UTC
Permalink
Post by astromono
I am getting to julia in recent months. I have hundreds
(thousands, perhaps) of functions and scrips in octave (many years
working with matlab/octave). I'm linux user (LMDE).
The fact is that from python I use oct2py module to run octave functions
with reasonably good results.
But in julia, using PyCall, this fails.
julia>pyimport oct2py.octave as oc
Can you file a PyCall issue? I'm not sure what is going on, as I don't
have the oct2py module installed at the moment and can't try it out
quickly, but it should be possible to get any Python module working from
Julia.
Roberto López López
2015-02-06 23:59:18 UTC
Permalink
I can run many pyton modules from julia, such as mayavi for example,
that it is complicated but oct2py break at first.

Rober
Post by astromono
I am getting to julia in recent months. I have hundreds
(thousands, perhaps) of functions and scrips in octave (manyyears
working with matlab/octave). I'm linux user (LMDE).
The fact is that from python I use oct2py module to run octave
functions with reasonably good results.
But in julia, using PyCall, this fails.
julia>pyimport oct2py.octave as oc
Can you file a PyCall issue? I'm not sure what is going on, as I
don't have the oct2py module installed at the moment and can't try it
out quickly, but it should be possible to get any Python module
working from Julia.
Páll Haraldsson
2015-02-10 10:39:47 UTC
Permalink
Since it should be possible to call any Python module, I'm not sure there
is much benefit to be able to call Octave directly. Except maybe:

There is a way to call MATLAB directly (and back) that doesn't involve
Python (I think). I haven't looked too much into it as I do not have to do
this personally (but a friend could use this). Those wrappers are probably
specific to call MATLAB. How hard would it be to make them generic? Or
should there be a third module for that (an abstract interface)? [And I'm
thinking along similar lines for my Decimal package that uses Python and
then another implementation that wraps C.]

It seems it would be unfortunate if the MATLAB wrapper's interface looks
different from the oct2py interface - is that inevitable? People who
already know that interface from Python expect that one (or do we not need
that compatibility?)? In Julia, things could be slightly different, but in
the end, you just want to call some MATLAB/Octave functions, right?
Couldn't most stuff at least be the same?
--
Palli.
Post by Steven G. Johnson
Post by astromono
I am getting to julia in recent months. I have hundreds
(thousands, perhaps) of functions and scrips in octave (many years
working with matlab/octave). I'm linux user (LMDE).
The fact is that from python I use oct2py module to run octave functions
with reasonably good results.
But in julia, using PyCall, this fails.
julia>pyimport oct2py.octave as oc
Can you file a PyCall issue? I'm not sure what is going on, as I don't
have the oct2py module installed at the moment and can't try it out
quickly, but it should be possible to get any Python module working from
Julia.
Roberto López López
2015-02-12 10:22:22 UTC
Permalink
Hi!
Of course! The point is to call m-octave functions, more or less
similar to matlab functions. I understand that matlab.jl package could
be a good solution if it opened the octave engine instead of opening the
matlab.

But in this case, matlab.jl uses calls to C-libraries of Matlab
(MxArray, mxClassID, mxComplexity, MSession, etc) which are not
equivalent in Octave.

Now, I am trying to find why oct2py doesn't work from Julia as other
modules what do.

I'll send an message if I can solve it.

Thanks folks,
Rober
Post by Páll Haraldsson
Since it should be possible to call any Python module, I'm not sure
There is a way to call MATLAB directly (and back) that doesn't involve
Python (I think). I haven't looked too much into it as I do not have
to do this personally (but a friend could use this). Those wrappers
are probably specific to call MATLAB. How hard would it be to make
them generic? Or should there be a third module for that (an abstract
interface)? [And I'm thinking along similar lines for my Decimal
package that uses Python and then another implementation that wraps C.]
It seems it would be unfortunate if the MATLAB wrapper's interface
looks different from the oct2py interface - is that inevitable? People
who already know that interface from Python expect that one (or do we
not need that compatibility?)? In Julia, things could be slightly
different, but in the end, you just want to call some MATLAB/Octave
functions, right? Couldn't most stuff at least be the same?
--
Palli.
I am getting to julia in recent months. I have hundreds
(thousands, perhaps) of functions and scrips in octave
(manyyears working with matlab/octave). I'm linux user (LMDE).
The fact is that from python I use oct2py module to run octave
functions with reasonably good results.
But in julia, using PyCall, this fails.
julia>pyimport oct2py.octave as oc
Can you file a PyCall issue? I'm not sure what is going on, as I
don't have the oct2py module installed at the moment and can't try
it out quickly, but it should be possible to get any Python module
working from Julia.
Loading...