Python to GNU Octave bridge --> run m-files from python.
Project description
Oct2py is a means to seemlessly call m-files and Octave functions from python. It manages the Octave session for you, sharing data behind the scenes using MAT files. Usage is as simple as:
>>> oc = oct2py.Oct2Py()
>>> x = oc.zeros(3,3)
>>> print x, x.dtype
[[ 0. 0. 0.]
[ 0. 0. 0.]
[ 0. 0. 0.]] float64
...
If you want to run legacy m-files, do not have MATLAB(TM), and do not fully trust a code translator, this is your library.
Features
Supports all Octave datatypes and most python datatypes and numpy dtypes.
Provides %octavemagic% for IPython, including inline plotting in notebooks.
Supports cell arrays and structs with arbitrary nesting.
Supports sparse matrices.
Builds methods on the fly linked to Octave commands (e.g. zeros above).
Nargout is automatically inferred by the number of return variables.
Thread-safety: each Oct2Py object uses an independent Octave session.
Can be used as a context manager.
Supports unicode characters.
Installation
You must have GNU Octave installed and in your PATH. On Windows, the easiest way to get Octave is to use an installer from sourceforge.. On Linux, it should be available from your package manager. Additionally, you must have the numpy and scipy libraries installed.
To install Oct2py, simply:
$ pip install oct2py
Or, if you absolutely must:
$ easy_install oct2py
Documentation
Documentation is available at http://pythonhosted.org/oct2py/.
Release History
1.1.1 (2013-11-14)
Added support for wheels.
Fixed: Put docs back in the manifest.
Fixed: Oct2py will install when there is no Octave available.
1.1.0 (2013-10-27)
Full support for plotting with no changes to user code
Support for Nargout = 0
Overhaul of front end documentation
Improved test coverage and added badge.
Supports Python 2 and 3 from a single code base.
Fixed: Allow help(Oct2Py()) and tab completion on REPL
Fixed: Allow tab completion for Oct2Py().<TAB> in REPL
1.0.0 (2013-10-4)
Support for Python 3.3
Added logging to Oct2Py class with optional logger keyword
Added context manager
Added support for unicode characters
Improved support for cell array and sparse matrices
Fixed: Changes to user .m files are now refreshed during a session
Fixed: Remove popup console window on Windows
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for oct2py-1.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 191237d42c636d3588dbc54cb7f873fd394c8cd7a6029818cde498a0bf4f4705 |
|
MD5 | d6e12c77668de51c1efd0f8670f046d5 |
|
BLAKE2b-256 | 7a5b07e7b4df302e9a2bfefd431c5a6a653ecf539574a06185cbbecc87cf056c |