Mercurial > pytave
view NEWS @ 321:3afd890fff6d
Rewrite pyobject.cell, always return a cell array of the right size
* @pyobject/cell.m: Rewrite, ensuring return value is always a cell array
of the correct size. Add more %!tests.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Thu, 11 Aug 2016 22:35:19 -0700 |
parents | 0c19ed1ce349 |
children |
line wrap: on
line source
Version 0.1.1-bzr 2012-04-09 * Removed Numeric array support. The Numeric array Python library is deprecated. Pytave has used numpy and its extensions since several years ago and it was time to reduce the effort to support both libraries. 2009-05-25 * Added functionality for explicit manipulation of variables. getvar, setvar, isvar can be used to get, set and query variables in the current Octave scope. Example: pytave.setvar("x", 1) pytave.eval(0,"x += 1") x = pytave.getvar("x") * Added functionality to push/pop anonymous scopes on the Octave call stack. push_scope and pop_scope are provided to create an anonymous scope and push it on Octave's call stack, to prevent cluttering other variables if nested calls to pytave are in effect. Example: pytave.push_scope() pytave.setvar("x", something) pytave.eval(0, "... do something with x) pytave.pop_scope() # wipes out x and restores its previous value, if any Of course, for proper safety, try/finally block should be used to ensure the cleanup. For convenience, a local_scope decorator is provided that encloses a whole function in a push_scope/try/finally/pop_scope sequence: @pytave.local_scope def my_oct_add(x,y): pytave.setvar("x",x) pytave.setvar("y",y) result, = pytave.eval(1, "x + y") return result this function, when called, will not affect the top-level values of x and y, if any. * The Octave welcome banner is now only displayed if Python is run interactively. * {}, "" and '' are now accepted as return values and converted to an empty list/string. 2009-05-07 * Added an eval function. A string of Octave code can be executed through this function. The returned values are converted to Python objects as with the feval function. In principle, this could be achieved simply using feval("eval", but the advantages to this implementation are: 1. faster (avoids double call and double conversion of code string) 2. explicit control of printing rather than implicitly with nargout (as in eval) 3. separate exception classes for parse error / execution error 2009-05-05 * Added functionality for one-row cell arrays. The Python list is converted to a one-row cell array and vice versa. * Added functionality for structs. The Python dictionary is converted to a Octave struct and vice versa. The implementation tries to be as true as possible to Octave's struct constructor.