-
Notifications
You must be signed in to change notification settings - Fork 2
/
NEWS
73 lines (52 loc) · 2.43 KB
/
NEWS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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.