Menu

Tree [r7] /
 History

HTTPS access


File Date Author Commit
 BaseRules.py 2009-03-02 schugschug [r5] Using CLIPS based Token translation.
 COPYING.txt 2009-03-02 schugschug [r5] Using CLIPS based Token translation.
 ChangeList 2009-03-02 schugschug [r7] Using CLIPS based Token translation.
 CommandLine.py 2009-02-21 schugschug [r2] initial version
 Mat2Py.py 2009-03-02 schugschug [r5] Using CLIPS based Token translation.
 MatlabLexer.py 2009-03-02 schugschug [r5] Using CLIPS based Token translation.
 MatlabParser.py 2009-03-02 schugschug [r5] Using CLIPS based Token translation.
 README.txt 2009-03-02 schugschug [r5] Using CLIPS based Token translation.
 RuleEngine.py 2009-03-02 schugschug [r5] Using CLIPS based Token translation.
 SConstruct 2009-03-02 schugschug [r5] Using CLIPS based Token translation.
 antlr.py 2009-02-21 schugschug [r1] initial version
 astrules.clp 2009-03-02 schugschug [r5] Using CLIPS based Token translation.
 libermate.py 2009-03-02 schugschug [r5] Using CLIPS based Token translation.
 mat2py.g 2009-03-02 schugschug [r5] Using CLIPS based Token translation.
 matcompat.py 2009-03-02 schugschug [r5] Using CLIPS based Token translation.
 translate_new.py 2009-03-02 schugschug [r5] Using CLIPS based Token translation.

Read Me

=== LiberMate ===

LiberMate - A MATLAB to Python (SciPy/NumPy) Translator 

Download from SourceForge website

===Setup===

extract tar file (e.g. under linux/unix type
$ tar zxvf libermate-0.2.tgz

===Run===

Change directory to the libermate directorie e.g.

$ cd libermate-0.1

To get command line help use  

$ python libermate.py -h

To convert a single test file type

$ python libermate.py Tests/colon.m

and will print the following output
--------------------
Opening File Tests/colon.m
Starting Parser
Parser Complete
Starting Translator
Translation Complete
writing to file Tests/colon.py


To convert all test files type

$ python libermate.py Tests/*.m

To output Abstract Syntax Tree from colon.m

$ python libermate.py --astdump Tests/colon.m

--------------------
Opening File Tests/colon.m
Starting Parser
Parser Complete
writing to file Tests/colon.ast
Starting Translator
Translation Complete
writing to file Tests/colon.py

This will create a file called Tests/colon.ast which contains the AST for the parsed file. The AST file can be useful to track where the Parser may have had problems.

LiberMate will attempt to convert MATLAB source files to python.
The MATLAB files must end with .m and the translated python code will
be written to python files, of the same name but ending with .py.

===Known Issues===

* LiberMate does not handle command style MATLAB expressions such as
  
  grid on

  instead use function expressions such as

  grid('on')

* LiberMate does not map all MATLAB functions to SciPy/NumPy equivalents.  It does
  map several common functions.

* LiberMate does not completely support freeform matrix expressions 
(e.g.

$ ./libermate.py Tests/matrix_tests.m

--------------------
Opening File Tests/matrix_tests.m
Starting Parser
syntax error: unexpected symbol at line 10 (column 4): "
 "
syntax error: unexpected symbol at line 11 (column 3): " "
Parser Complete
Starting Translator
error: unexpected end of subtree
Translation Complete
writing to file Tests/matrix_tests.py

The output shows two errors on lines 10 and 11 that are cause by an initial newline and final newline in matrix expression for variable d.


* numpy does not automatically grow arrays
* python scalars behave differently from matlab arrays
* plot title,ylabel do not take extra arguments
* missing waitbar function
* 

TODO
* replace a.copy() with copy(a)
* 


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.