Skip to content

Commit 1a1152d

Browse files
committed
Add change log for version 0.21
1 parent 78bb1bf commit 1a1152d

File tree

2 files changed

+124
-5
lines changed

2 files changed

+124
-5
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
New features
2+
------------
3+
4+
* implemented replaced_axes() method to replace one, several or all axes of an array
5+
(instead of using the workaround a.with_axes(a.axes.replace(...)))
6+
(closes :issue:`67`).
7+
8+
>>> arr = ndtest((2, 3))
9+
>>> arr
10+
a\\b | b0 | b1 | b2
11+
a0 | 0 | 1 | 2
12+
a1 | 3 | 4 | 5
13+
>>> row = Axis('row', ['r0', 'r1'])
14+
>>> column = Axis('column', ['c0', 'c1', 'c2'])
15+
16+
Replace one axis (expect 2 arguments)
17+
18+
>>> arr.replace_axes(x.a, row)
19+
row\\b | b0 | b1 | b2
20+
r0 | 0 | 1 | 2
21+
r1 | 3 | 4 | 5
22+
23+
Replace several axes (keywords, list of tuple or dictionary)
24+
25+
>>> arr.replace_axes(a=row, b=column)
26+
row\\column | c0 | c1 | c2
27+
r0 | 0 | 1 | 2
28+
r1 | 3 | 4 | 5
29+
>>> arr.replace_axes([(x.a, row), (x.b, column)])
30+
row\\column | c0 | c1 | c2
31+
r0 | 0 | 1 | 2
32+
r1 | 3 | 4 | 5
33+
>>> arr.replace_axes({x.a: row, x.b: column})
34+
row\\column | c0 | c1 | c2
35+
r0 | 0 | 1 | 2
36+
r1 | 3 | 4 | 5
37+
38+
Replace all axes (list of axes or AxisCollection)
39+
40+
>>> arr.replace_axes([row, column])
41+
row\\column | c0 | c1 | c2
42+
r0 | 0 | 1 | 2
43+
r1 | 3 | 4 | 5
44+
>>> arr2 = ndrange([row, column])
45+
>>> arr.replace_axes(arr2.axes)
46+
row\\column | c0 | c1 | c2
47+
r0 | 0 | 1 | 2
48+
r1 | 3 | 4 | 5
49+
50+
* implemented from_string() method to create an array from a string:
51+
52+
>>> from_string('''nat\\sex, M, F
53+
... BE, 0, 1
54+
... FO, 2, 3''')
55+
nat\sex | M | F
56+
BE | 0 | 1
57+
FO | 2 | 3
58+
>>> from_string('''age,nat\\sex, M, F
59+
... 0, BE, 0, 1
60+
... 0, FO, 2, 3
61+
... 1, BE, 4, 5
62+
... 1, FO, 6, 7''')
63+
age | nat\sex | M | F
64+
0 | BE | 0 | 1
65+
0 | FO | 2 | 3
66+
1 | BE | 4 | 5
67+
1 | FO | 6 | 7
68+
69+
Miscellaneous improvements
70+
--------------------------
71+
72+
* readme.rst + doc : add installation instructions (closes :issue:`101`).
73+
74+
* allowed to use regex in split_axis method (closes :issue:`106`):
75+
76+
>>> combined = ndrange('a_b = a0b0..a1b2')
77+
>>> combined
78+
a_b | a0b0 | a0b1 | a0b2 | a1b0 | a1b1 | a1b2
79+
| 0 | 1 | 2 | 3 | 4 | 5
80+
>>> combined.split_axis(x.a_b, regex='(\w{2})(\w{2})')
81+
a\\b | b0 | b1 | b2
82+
a0 | 0 | 1 | 2
83+
a1 | 3 | 4 | 5
84+
85+
* allowed multiplication (__matmul__ or @ operator) between matrices with dimension != 2 (closes :issue:`122`).
86+
87+
* implemented Axis.by() which is equivalent to axis[:].by()
88+
89+
* viewer : automatically display plots done in the viewer console in a separate window
90+
(unless "%matplotlib inline" is used)
91+
92+
Fixes
93+
-----
94+
95+
* viewer: allow changing the number of displayed digits even for integer arrays as that makes sense when using
96+
scientific notation (closes :issue:`100`).
97+
98+
* viewer : make shortcuts work even when the focus is not on the array editor widget
99+
(ie it is on the array list, or on the interactive console) (closes :issue:`102`).
100+
101+
* viewer : fixed opening a viewer via view() edit() or compare() from within the viewer
102+
(closes :issue:`109`)
103+
104+
* viewer : fixed compare() colors when arrays have values which are very close but not exactly equal
105+
(closes :issue:`123`)
106+
107+
* viewer : fixed plot legend (it displayed the wrong labels when selecting arbitrary rows before)
108+
(closes :issue:`136`).
109+
110+
* fixed posargsort labels (closes :issue:`137`).

larray/core.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3947,7 +3947,7 @@ def replace_axes(self, axes_to_replace=None, new_axis=None, **kwargs):
39473947
list of tuple (axis ref, axis) or list of Axis or
39483948
AxisCollection
39493949
Axes to replace. If a single axis reference is given,
3950-
the `new_axes` argument must be used. If a list of
3950+
the `new_axis` argument must be used. If a list of
39513951
Axis or an AxisCollection is given, all axes will be
39523952
replaced by the new ones. In that case, the number of
39533953
new axes must match the number of the old ones.
@@ -3976,14 +3976,16 @@ def replace_axes(self, axes_to_replace=None, new_axis=None, **kwargs):
39763976
a1 | 3 | 4 | 5
39773977
>>> row = Axis('row', ['r0', 'r1'])
39783978
>>> column = Axis('column', ['c0', 'c1', 'c2'])
3979+
3980+
Replace one axis (expect 2 arguments)
3981+
39793982
>>> arr.replace_axes(x.a, row)
39803983
row\\b | b0 | b1 | b2
39813984
r0 | 0 | 1 | 2
39823985
r1 | 3 | 4 | 5
3983-
>>> arr.replace_axes([row, column])
3984-
row\\column | c0 | c1 | c2
3985-
r0 | 0 | 1 | 2
3986-
r1 | 3 | 4 | 5
3986+
3987+
Replace several axes (keywords, list of tuple or dictionary)
3988+
39873989
>>> arr.replace_axes(a=row, b=column)
39883990
row\\column | c0 | c1 | c2
39893991
r0 | 0 | 1 | 2
@@ -3993,6 +3995,13 @@ def replace_axes(self, axes_to_replace=None, new_axis=None, **kwargs):
39933995
r0 | 0 | 1 | 2
39943996
r1 | 3 | 4 | 5
39953997
>>> arr.replace_axes({x.a: row, x.b: column})
3998+
row\\column | c0 | c1 | c2
3999+
r0 | 0 | 1 | 2
4000+
r1 | 3 | 4 | 5
4001+
4002+
Replace all axes (list of axes or AxisCollection)
4003+
4004+
>>> arr.replace_axes([row, column])
39964005
row\\column | c0 | c1 | c2
39974006
r0 | 0 | 1 | 2
39984007
r1 | 3 | 4 | 5

0 commit comments

Comments
 (0)