Mercurial > pytave
annotate NEWS @ 44:f237eb38e9c3
update NEWS
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Mon, 25 May 2009 13:22:20 +0200 |
parents | 798efee55cd0 |
children | 0c19ed1ce349 |
rev | line source |
---|---|
36
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
1 Version 0.1.1-bzr |
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
2 |
44 | 3 2009-05-25 |
4 | |
5 * Added functionality for explicit manipulation of variables. | |
6 getvar, setvar, isvar can be used to get, set and query variables | |
7 in the current Octave scope. | |
8 Example: | |
9 pytave.setvar("x", 1) | |
10 pytave.eval(0,"x += 1") | |
11 x = pytave.getvar("x") | |
12 | |
13 * Added functionality to push/pop anonymous scopes on the Octave call | |
14 stack. push_scope and pop_scope are provided to create an anonymous scope | |
15 and push it on Octave's call stack, to prevent cluttering other variables if | |
16 nested calls to pytave are in effect. | |
17 | |
18 Example: | |
19 pytave.push_scope() | |
20 pytave.setvar("x", something) | |
21 pytave.eval(0, "... do something with x) | |
22 pytave.pop_scope() # wipes out x and restores its previous value, if any | |
23 | |
24 Of course, for proper safety, try/finally block should be used to ensure the | |
25 cleanup. For convenience, a local_scope decorator is provided that encloses a | |
26 whole function in a push_scope/try/finally/pop_scope sequence: | |
27 | |
28 @pytave.local_scope | |
29 def my_oct_add(x,y): | |
30 pytave.setvar("x",x) | |
31 pytave.setvar("y",y) | |
32 result, = pytave.eval(1, "x + y") | |
33 return result | |
34 | |
35 this function, when called, will not affect the top-level values of x and y, if | |
36 any. | |
37 | |
38 * The Octave welcome banner is now only displayed if Python is run interactively. | |
39 | |
40 * {}, "" and '' are now accepted as return values and converted to an empty list/string. | |
41 | |
36
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
42 2009-05-07 |
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
43 |
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
44 * Added an eval function. A string of Octave code can be executed |
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
45 through this function. The returned values are converted to Python |
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
46 objects as with the feval function. |
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
47 |
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
48 In principle, this could be achieved simply using feval("eval", but |
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
49 the advantages to this implementation are: |
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
50 |
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
51 1. faster (avoids double call and double conversion of code string) |
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
52 |
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
53 2. explicit control of printing rather than implicitly with nargout |
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
54 (as in eval) |
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
55 |
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
56 3. separate exception classes for parse error / execution error |
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
57 |
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
58 2009-05-05 |
22 | 59 |
33 | 60 * Added functionality for one-row cell arrays. The Python list is |
61 converted to a one-row cell array and vice versa. | |
22 | 62 |
37
798efee55cd0
Added --enable-float-matrices option. Some VPATH building issues fixed. Changelog now more standardized.
David Grundberg <individ@acc.umu.se>
parents:
36
diff
changeset
|
63 * Added functionality for structs. The Python dictionary is converted |
33 | 64 to a Octave struct and vice versa. The implementation tries to be |
65 as true as possible to Octave's struct constructor. | |
36
ae4554656fa1
Added an eval function.
David Grundberg <individ@acc.umu.se>
parents:
33
diff
changeset
|
66 |