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 `).
0 commit comments